fix(shell): preserve task origin in job snapshots - #5869
Merged
1 commit merged intoSep 5, 2026
Merged
Conversation
Signed-off-by: zhuowp <zwp-1989@qq.com>
Contributor
|
Thanks @zhuowp for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
This was referenced Sep 4, 2026
Garfield1985
pushed a commit
to Garfield1985/DeepSeek-TUI
that referenced
this pull request
Sep 5, 2026
Background shell job snapshots and completion events carried no stable identity for the work that created them, so a host reconciling updates had to fall back on heuristics like matching command text. With several jobs live in one session that mis-attributes: an earlier job's error output could land on a newer tool card. The fix stamps the originating turn id and tool-call id onto `ToolContext` at dispatch, freezes them when a `BackgroundShell` is created, and carries them through job snapshots, completion events, runtime handoffs, and evidence artifacts. New fields are `serde(default)`, so payloads written before this change still deserialize. Reviewed rather than taken on the title: all three dispatch sites in `execute_planned_tools` route through the new `tool_context_for_call` — ordinary parallel, the serial path, and the approval-context override — so no path can produce an unstamped context. Shell execution, permissions, output buffering, job lifecycle, and completion delivery are untouched. Merged as one commit authored by zhuowp; `merge-tree` was clean against main and CI was green on the branch. Gates: fmt CLEAN · clippy -p codewhale-tui PASS · nextest -p codewhale-tui 12007 passed / 0 failed / 13 skipped. A first run showed `session_control_acceptance::tui_and_api_listings_agree` failing under parallel load; it passes in isolation and the full re-run was clean, so it is load flake, not this change. Harvested-from: PR Hmbown#5869 by @zhuowp Co-authored-by: zhuowp <9426526+zhuowp@users.noreply.github.com> Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCLLenseqfQdVaZUBqn9yG
Garfield1985
pushed a commit
to Garfield1985/DeepSeek-TUI
that referenced
this pull request
Sep 5, 2026
0.9.12 had no `### Contributors` section, `web/lib/release-credits.ts` still held the 0.9.11 cohort, and the contributor doc band was missing five people whose work landed. Three surfaces that must agree, disagreeing three ways. Everyone whose work reached main this cycle is now named in all three, derived from `Co-authored-by` and `Harvested-from` trailers on v0.9.11..HEAD rather than from memory. The five who were missing: - @qiuYliangM (秋月凉梦) — co-author on Hmbown#5621, Hmbown#5622, Hmbown#5623 - @whp233 — Hmbown#5716, landed as Hmbown#5719 - @Gabriel-Degret — Hmbown#5867 - @huangxianzhan — Hmbown#5868 - @zhuowp — Hmbown#5869 @aboimpinto's entry gained Hmbown#5825 and Hmbown#5865, @M-Maciej's gained Hmbown#5533/Hmbown#5831. `requiredCandidateCredits` in public-surface-facts.json moves from the 0.9.11 cohort to this one — that guard is meant to hold the *current* release's credits in every surface, and it had been pinning the previous release's. `RELEASE_HELPERS` is deliberately empty. Every credited contribution this cycle arrived as code that landed; a name there that no landed change can point at would be a nicer-looking ledger and a less true one. AUTHOR_MAP gains canonical numeric-noreply identities for all five, since the trailers on their harvest commits used raw emails and old-style noreply addresses. web: 386 tests, 386 passed. check:facts, check:docs, check:tokens, check:locales all PASS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QCLLenseqfQdVaZUBqn9yG
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
Background shell job snapshots and completion events do not carry stable origin identifiers. When multiple jobs exist in the same session, a host must rely on heuristics such as command text to reconcile updates, which can project an earlier job's error output onto a newer tool card.
Changes
multi_tool_use.parallel.BackgroundShellis created and preserve it through job snapshots, completion events, runtime handoffs, and evidence artifacts.serde(default)for the new fields so payloads created before this change remain compatible.Verification
cargo fmt --all -- --checkcargo check -p codewhale-tui --lib --lockedtool_context_for_call_preserves_turn_and_sets_call_originbackground_shell_job_preserves_origin_identitydrain_finished_jobs_reports_onceshell_completion_status_is_concise_and_shell_handoff_is_untrustedcompletion_evidence_preserves_arbitrary_stream_bytesEach targeted test was executed and passed.