Skip to content

feat(agent): make task lists durable across context compaction - #416

Merged
yyg-max merged 2 commits into
mainfrom
refactor/stable-task-list
Aug 10, 2026
Merged

feat(agent): make task lists durable across context compaction#416
yyg-max merged 2 commits into
mainfrom
refactor/stable-task-list

Conversation

@su-fen

@su-fen su-fen commented Aug 10, 2026

Copy link
Copy Markdown
Member

Linked issue

Closes #325

Summary

  • Replace the full-list TodoWrite protocol with TaskCreate, TaskUpdate, and TaskList using stable executor-assigned task IDs.
  • Persist the authoritative runId, revision, and task state in conversation metadata so compaction and prune operations preserve the same task list.
  • Atomically flush the finalized history segment before appending a compaction checkpoint, and reject runtime segment switches when persistence fails.
  • Clear task state at real user-run boundaries, including edit-resend, while rejecting stale run IDs and degrading corrupt stored task state safely.
  • Remove the legacy Todo rendering/sequencing pipeline and keep GUI/Gateway WebUI on the same canonical task-progress projection.

Change scope

  • Modules: agent-gui, agent-gui/src-tauri, agent-ui, agent-gateway/web
  • Key paths:
    • crates/agent-gui/src/lib/tools/taskState.ts
    • crates/agent-gui/src/lib/tools/taskTools.ts
    • crates/agent-gui/src/lib/chat/compaction/
    • crates/agent-gui/src/lib/chat/history/
    • crates/agent-ui/src/lib/chat/taskProgress.ts
    • crates/agent-ui/src/components/chat/TaskProgressIndicator.tsx

Screenshots / preview

Verification

  • pnpm test:gui — 1500/1500 passed
  • pnpm test:webui — 539/539 passed
  • cargo test --manifest-path crates/agent-gui/src-tauri/Cargo.toml chat_history --lib — 57/57 passed
  • pnpm build:gui — passed
  • pnpm build:webui — passed
  • pnpm lint:gui — passed
  • pnpm lint:webui — passed
  • cargo check --manifest-path crates/agent-gui/src-tauri/Cargo.toml --tests — passed
  • cargo fmt --manifest-path crates/agent-gui/src-tauri/Cargo.toml --check — passed
  • pnpm check:ui-boundaries — passed
  • git diff --check — passed

Pre-submit checklist

  • A requirement issue is linked.
  • Synced with the target branch; no merge conflicts at submission time.
  • The change is focused on durable task continuity across context compaction.
  • No secrets, tokens, or personal data are included.
  • Affected behavior and invariants are documented.
  • Screenshots / preview added.

@yyg-max yyg-max added the governance-exempt Skip PR governance checks label Aug 10, 2026
@yyg-max
yyg-max marked this pull request as ready for review August 10, 2026 05:36
@yyg-max
yyg-max merged commit 38f8187 into main Aug 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

governance-exempt Skip PR governance checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

上下文检查异常

2 participants