Skip to content

fix(assistant): preserve committed terminal diagnostic outcome - #1097

Open
wcy12378 wants to merge 1 commit into
Tencent:mainfrom
wcy12378:codex/terminal-diagnostic
Open

wcy12378 wants to merge 1 commit into
Tencent:mainfrom
wcy12378:codex/terminal-diagnostic

Conversation

@wcy12378

@wcy12378 wcy12378 commented Nov 19, 2026 •

Copy link
Copy Markdown

Fixes #1085.

A successful terminal submission deliberately cancels the model process. The assistant accepts the reply, but its CLI attempt records that cleanup as cancelled / context canceled.

Bind each reply-producing CLI invocation to its terminal tool session. Diagnostics treat cancellation as completion only when that exact session committed a terminal result, and record cli.terminal_committed as the reason. Other failures, external cancellation, timeouts, earlier/later attempts, and concurrent approval-review attempts retain their own outcomes. The execution error and orchestration behavior are unchanged. Chat, bot replies, and report invocations pass their owning session; approval and helper invocations do not.

Validation: Go 1.26.11, Linux amd64, CGO disabled, test binary executed in a Linux container with the package directory as its working directory.

GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go test -c -o httpapi.test ./internal/httpapi
# Run from internal/httpapi so fixtures and repository assets resolve:
./httpapi.test -test.run='^(TestAssistantDiagnostic.*|TestGenerationSurvivesRequestAndCanBeCancelled|TestGenerationCompletedReplyAndSnapshot|TestAgentTool.*|TestSOPReport.*|TestBot.*)$' -test.v -test.timeout=90s
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go vet ./internal/httpapi
py -X utf8 scripts/check-public.py
git diff --check
  • 48 top-level tests passed, 0 failed, 0 skipped, including terminal completion versus cancellation, concurrent review ownership, and completed generation/diagnostic persistence. The pre-fix terminal-cleanup regression failed with Status:cancelled Error:context canceled.
  • The pre-change diagnostic/generation baseline passed 13 top-level tests. An initial container invocation from / could not resolve fixture/source paths; rerunning with the package working directory passed.
  • Related-package vet and public-content/diff checks passed.
  • npm --prefix chatbot run build passed on the rebased source. The 48-test suite and related vet were rerun on base 6f606cf after preserving its model selection and prompt assembly changes.

Full repository tests, browser acceptance, and live provider tests were not run. Native Windows compilation of httpapi has existing Unix syscall dependencies; validation used the Linux target.

@wcy12378
wcy12378 force-pushed the codex/terminal-diagnostic branch from 73de907 to 1594daf Compare November 19, 2026 15:41
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.

[Bug]: 已成功提交回复的轮次被诊断记为 cancelled / context canceled

1 participant