Skip to content

fix(task): preserve resident transcript storage across same-owner session moves - #6747

Merged
probepark merged 1 commit into
devfrom
fix/session-move-integration-qualification
Oct 14, 2026
Merged

probepark merged 1 commit into
devfrom
fix/session-move-integration-qualification

Conversation

@snowykr

@snowykr snowykr commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

Reproduced defect

Follow-up verification after #6688 found real SDK execution failures, not merely untested combinations. On dev, a queued A Task could start against the removed A artifact namespace after its parent moved to B. An already-running child executed Bash in A correctly but then failed transcript persistence (ENOENT on the old managed artifact directory), so its final status was failed rather than completed.

Repair

  • Keep immutable admitted execution inputs and the original ToolSession owner; refresh only managed persistence for the same parent ID and parent transcript basename.
  • Rebind the original live child SessionManager in place only after verifying the authorized destination root and identical transcript byte size/SHA256. Do not reopen the child or change its cwd, ID, or conversation.
  • Publish outputs through the same verified relocated capability. Refresh derived artifact authority after physical rollback, including same-path directory identity replacement.
  • Re-prepare async metadata on verified storage-only relocation; revoke the resolver and origin at real child reset/adoption/branch commits. Different copied data and successor storage remain refused.

No settings, protocol, public admission/completion policy, before-move availability gate, authority map, persistent owner, or filesystem-lifetime lease is added. No image changes are included.

Verification

Base: 01a5eff05 (current dev at verification). Exact submitted head: 8dfcfa75f09d3871767b084b9b2a1dcef7f4bb96.

  • Integrated union: 365 pass, 0 fail, 3 existing credential-gated skips; 1,735 assertions across 26 files.
  • New real execution tests use actual child AgentSessions and Bash processes; only the external LLM is deterministic. They cover direct SessionManager and public move_session, active and queued A work, new B work, same-child pause/resume, and public agent:// output reads.
  • Real MCP newline JSON-RPC/roots-list and LSP Content-Length subprocess integration; rejected moves, reset and persisted reopen.
  • Copied-byte mismatch, same-path physical rollback, logical parent successors, child reset/adoption/branch revocation, and controlled async preparation-fence races.
  • bun --cwd=packages/coding-agent run check: exit 0 (Markit vendor, Biome 3,535 files, docs index and TypeScript). One unsuppressed existing warning: unchanged-in-this-PR agent-session.ts exceeds Biome's 1 MiB file limit.
  • Scoped Biome and git diff checks passed. Three skipped live Anthropic branching tests were not changed or suppressed.
  • Advisory source re-review CLEAR after correcting child logical-lifecycle capability revocation; this is not maintainer approval.

Qualification limits

This path qualifies resident hot/shadow managed transcripts. Cold-sidecar/bounded sources, staged publications, recovery and writer-backed states retain explicit fail-closed guards; this PR does not claim those relocation combinations work. The tests do not establish original-operation I/O closure, namespace lifetime/deletion guarantees, or universal move coverage. Full repository/Rust suites were not run; native production is unchanged and generated local native diagnostic metadata is excluded.

Production/tool-prompt review delta: 292 added+deleted lines, native production 0, within the 800-line budget. Main checkout, imported historical drafts and session evidence remain preserved.

…moves

Queued and running Tasks retained a physically removed artifact namespace even
though their original execution inputs and logical owner remained valid.
Verify copied transcript identity before rebinding only storage, and revoke the
relocation capability at actual child logical lifecycle commits.

Lore-id: task-move-managed-storage-20261014
Constraint: retain admitted cwd, child identity, conversation, and original ToolSession ownership
Constraint: relocation requires the same parent identity and exact copied transcript size and SHA256
Rejected: wait for running Tasks before allowing moves | introduces an availability policy
Rejected: recreate the live AgentSession | discards in-flight state and admitted service identity
Confidence: high
Scope-risk: bounded
Reversibility: easy
Tested: 365 passing tests across 26 files, 1735 assertions, three existing credential-gated skips
Tested: real child AgentSessions, Bash processes, MCP/LSP subprocesses, and public agent output references
Tested: full coding-agent package check and diff checks
Not-tested: cold or bounded, staged, recovery-backed, and writer-backed transcript relocation
Not-tested: original-operation filesystem lifetime and full repository Rust suites
@snowykr

snowykr commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Advisory architect source-review receipt for head 8dfcfa75f09d3871767b084b9b2a1dcef7f4bb96: CLEAR, no remaining concrete blocker in the scoped storage contract.

The initial blocker was a relocation resolver/token origin leaking across the relocated child's own reset/adoption/branch commits. Those successful logical commits now clear the capability; token identity independently includes the actual current child session ID. New regressions assert that predecessor metadata aborts and later parent moves cannot retarget successor data. Copy digest/root identity checks and unchanged-authority fast paths remain intact.

Accepted limits remain explicit: resident managed storage only; cold/bounded/staged/recovery/writer states are fail-closed, not a hidden admission or shutdown policy and not a filesystem-lifetime guarantee. Parent integrated verification: 365 passing tests / 1,735 assertions, three unchanged credential-gated skips, full coding-agent package check exit 0 with the existing oversized-file warning unsuppressed.

This comment is advisory source review and local verification evidence, not a write-access maintainer approval. No merge action has been taken.

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review (CI still running on 8dfcfa7; approval decision follows once CI finishes).

Review (head 8dfcfa7, gajae-reviewer on behalf of probepark)

Blocking: None found in the reviewed production diff.
ocr: blocking 0 / nit 0

CI: Approval held. gajae-approve-gate.py 6747 --head 8dfcfa75f09d3871767b084b9b2a1dcef7f4bb96 returned HOLD_CI (exit 10). Four items remain: RSS checkpoint compare, Windows session-path regression, state-gates native addon, and the affected-path aggregate. The exact-head coding-agent check passed. No failed checks were reported.

Scope: +1433 / -28, 11 files. OCR selected three production TypeScript files: +263 / -27 (290 changed lines). Remaining changes cover documentation, a changelog fragment, a prompt, and regression/integration fixtures.

Conventions: Per-change changelog fragment present. No released changelog edits, generated artifacts, new workers, or default-workflow expansion. No labels.

Notable / checked and clean:

  • packages/coding-agent/src/task/index.ts:918-939 checks the admitted parent ID and transcript basename before refreshing artifact persistence. captureTaskExecutionScope retains execution cwd and session identity; artifact accessors remain bound to the original owner. This separates storage relocation from a successor session.
  • packages/coding-agent/src/session/session-manager.ts:12998-13062 refuses cold, bounded, staged, writer-backed, and recovery states. It verifies destination authority, byte size, and SHA256 before changing the resident child's storage root.
  • packages/coding-agent/src/session/session-manager.ts:16758-16780 refreshes relocation before preparation and again inside the persistence fence. A storage-only path change forces re-preparation; logical lifecycle changes still abort. Reset/adoption/branch commits revoke the resolver.
  • packages/coding-agent/src/task/executor.ts:355-370,391-402 resolves managed storage for child opening and output publication without changing child execution cwd.

Spec axis: The PR's stated resident same-owner storage repair matches the reviewed implementation. The qualification limits remain explicit in docs/tools/task.md.

Execution evidence: Exact-head CI job https://github.com/Yeachan-Heo/gajae-code/actions/runs/38535360604/job/115761101602 ran the public SDK Task execution integration suite at 08:41-08:42 UTC. Logs show 3 pass / 0 fail: direct-manager move, public move_session, and same-child pause/resume. These cases execute actual child sessions and Bash with a deterministic external provider. The managed-storage relocation and SDK service suites also report successful CI checks.

Could not assess: Full repository/Rust suites and real external-provider behavior were not run locally. Cold/bounded/staged/recovery/writer relocation is outside this PR's qualified contract. Pending CI prevents an approval decision; no merge-readiness claim is made.

Verdict: HOLD_CI. PR body unchanged.

@probepark probepark left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review (head 8dfcfa7, gajae-reviewer on behalf of probepark)

Blocking: None. CI finished; no blocking findings.
ocr: blocking 0 / nit 0

Code review: #6747 (review)
The reviewed head is unchanged. No later peer change request or new finding was observed.

CI: python3 /opt/data/scripts/gajae-approve-gate.py 6747 --head 8dfcfa75f09d3871767b084b9b2a1dcef7f4bb96 returned ALLOW (exit 0).
Pending: 0. Failed: 0. Required local checks missing: 0. Exact-head coding-agent check is covered.
The prior review records actual SDK/Bash integration execution: 3 pass / 0 fail.

Scope: +1433 / -28, 11 files; 290 OCR-selected production lines. Code findings and qualification limits remain in the linked review.
Conventions: Changelog fragment present; no released changelog or generated-file edits.
Digest: Recomputed from the binary full-index base-to-head merge-base diff; matches the prior review receipt.

PR body verdict line count=0, not updated. Body verdict line is owned by author snowykr; not edited.
Suggested verdict line: gajae.pr-review-verdict.v1 merge-approved sha256:8359c8f5f5862068c37ac9586450a2b6e93c44bd4b28924bde51c2db8fd7beb2 reviewer:human reviewer-id:probepark evidence:ci-finished;coding-agent-check-covered;sdk-bash-integration-passed;exact-head-code-review-blocking-zero

Verdict: APPROVE for this exact head. No merge action taken.

@probepark
probepark merged commit 28a21fe into dev Oct 14, 2026
34 checks passed
@probepark

Copy link
Copy Markdown
Collaborator

Merged to dev: approved at 8dfcfa7, checks green, no open concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants