Skip to content

fix(context): 显式标记空 Todo 状态#691

Merged
phantom5099 merged 5 commits into
1024XEngineer:mainfrom
Yumiue:codex/gateway-plan-approval-rpc
May 22, 2026
Merged

fix(context): 显式标记空 Todo 状态#691
phantom5099 merged 5 commits into
1024XEngineer:mainfrom
Yumiue:codex/gateway-plan-approval-rpc

Conversation

@Yumiue
Copy link
Copy Markdown
Collaborator

@Yumiue Yumiue commented May 21, 2026

背景

关联 RFC issue:Closes #690

继续对话时,如果上一轮已经清空或完成 todo,context builder 之前会直接省略 Todo State 区块。模型在后续推理中无法明确区分“当前没有待办”和“旧待办仍可沿用”,容易继续写入已清空的 todo,形成 todo conflict。

当前修改

  • internal/context 中,当 todo 列表为空或全部处于终态时,显式输出 Todo State: None
  • 同步 build execution prompt:缺失 Todo StateTodo StateNone 时,都要求先创建当前 run 的 required todos。
  • 补齐空 todo、全部终态 todo、prompt 空状态语义的边界测试。
  • 允许 control plane 从 verify 回到 execute,覆盖验证阶段发现仍需执行动作的状态转换。
  • 修复 Web todo 面板状态收敛:runtime reset snapshot 会清理 stale todoConflict,普通 conflict snapshot 仍保留冲突提示。

验证

  • go test ./internal/context ./internal/runtime/controlplane ./internal/promptasset
  • npm --prefix web test -- useRuntimeInsightStore eventBridge

风险与回滚

  • 风险:提示中会固定出现 Todo State: None,会带来极少量 token 增量。
  • 回滚:如该语义影响模型行为,可回滚 context 输出、prompt wording、Web reset conflict 清理与 verify -> execute 状态转换。

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

Copy link
Copy Markdown

@fennoai fennoai Bot left a comment

Choose a reason for hiding this comment

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

Found 1 issue after code quality, performance, security, and documentation-accuracy passes.

Comment thread internal/context/source_todos.go
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@phantom5099 phantom5099 merged commit 15f7bdb into 1024XEngineer:main May 22, 2026
3 checks passed
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.

【提案】 显式标记空 Todo 状态避免继续对话冲突

2 participants