Repository navigation
fix: harden workflow cleanup, replay leases, child provenance, and Web draft recovery - #925
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Several runtime, replay, permission, and Web projection boundaries had narrow race or recovery gaps:
reclaimWorktreebefore the child working directory was confirmed quiescent, and retaining an admission lease across late session creation could leak the shared child-execution slot once late disposal succeeded.replayLease.canReplaywas captured statically beforeawait getResources(...), allowing cache hits after an overlapping unsafe call entered during resource loading. In addition,git_show/git_diff/git_logwere treated as replayable without hashing Git index/ref state, andgit_log(fileparameter) was rejected by thepath-only replay filesystem wrapper.sourceInfoon the parent side but forwarded tool names only, allowing a same-named tool from another trustedcwdto satisfy final binding by name alone.contexthook edits.prompt_blockedpublication, deleting a session left orphaned compaction draft backups in browser storage, settled/reopened subagent and workflow transcripts dropped nestedparentToolCallIdlinks, andtool-argumentsperformed unboundedJSON.stringify/ stripped leading BOMs in paths while Web streamed redundantprojectMessagecalls when tracing was off.Value
childExecutionscapacity after late shutdown completes.git_logexecution inside read-only workflow children.OP-06).Approach
Validation
bun run check— passed (check:config-contract,check:docs-contract,check:discipline,check:web+build:web,format:check,lint,typecheck).bun run test— passed (2,516Node tests passed,8platform-conditional skipped;1,677Vitest UI tests passed).git_log/git_diffstaging changes, cross-cwd same-name tool provenance rejection, Plan clock-skew/hook-redaction ordering, compaction draft recovery/cleanup, nested tool lineage, and bounded BOM-safe argument previews.Impact
git_logworks inside read-only workflow agents.~/.pi/agent/my-pi-setup.json; workflow replay keys now incorporate verified tool provenance (older cache keys safely miss and re-execute once); browser draft storage cleans up entries for confirmed deleted sessions.>=0.99.1, tested against locked1.2.0and CI endpoint jobs).