Skip to content

feat(goal): sync blocked lifecycle and user abort handling - #382

Merged
code-yeongyu merged 2 commits into
mainfrom
feat/goal-todo-resync
Jul 26, 2026
Merged

feat(goal): sync blocked lifecycle and user abort handling#382
code-yeongyu merged 2 commits into
mainfrom
feat/goal-todo-resync

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Sync the vendored goal builtin to pi-goal 0.3.0: completed-goal replacement with JSONL history, marker-aware 4,000-code-point objective spills, and blocked lifecycle persistence/tool semantics.
  • Deliver an explicit agent-end abort payload (aborted, abortSource) and use it to block only user-interrupted active goals; the next real user run resumes them.
  • Align vendored pi-todotools provenance to 0.2.0 while retaining Senpi renderer, /todo, builtin identity, and persistence-key adaptations.

Provenance

Verification

  • npm run check at repository root
  • npx vitest run goal goal-extension goal-turn-usage goal-modules goal-store goal-abort-extension app-server-thread-goal todo builtin-extension-sync (144 tests)
  • Isolated real-CLI mock-loop QA receipts: local-ignore/qa-evidence/20260726-goal-todo-resync/
    • create -> complete -> create/archive
    • blocked with reason -> next-user-message resume
    • 4,200-character objective spill
    • todo init/start/done/append/view
    • abort injection is not exposed by the mock-loop helper; goal-abort-extension.test.ts supplies the deterministic ESC-abort proof.

Summary by cubic

Syncs the goal builtin to pi-goal@0.3.0 and todo tools to pi-todotools@0.2.0, adding a blocked goal lifecycle, JSONL goal history, 4,000‑char objective truncation with spill files, and explicit user/system abort attribution so only user‑aborted turns block and the next user‑triggered run resumes.

  • New Features

    • Blocked lifecycle: model may set blocked with a non-empty reason; persisted as blockedReason/blockedAt; no auto-continue while blocked; the next user run resumes to active.
    • Abort handling: agent_end now includes aborted and abortSource; user-aborted active turns are marked blocked after usage accounting; system aborts do not block.
    • Objective handling: 4,000 code point limit with marker-aware truncation; full text saved to <thread>.objective-full.txt; tool responses include a truncation notice.
    • Goal replacement + history: create_goal replaces a completed goal and appends the old goal to <thread>.history.jsonl; rejected if an unfinished goal exists.
    • Tools/API: update_goal supports complete and blocked (requires reason for blocked, rejects reason for complete); guidance updated to avoid premature blocking and to audit repeated blocks; create_goal docs note limits and replacement; thread API exposes blocked on get while thread/goal/set still rejects setting blocked directly.
    • Accounting/UI: usage accounted for blocked turns; continuation suppressed while blocked; UI shows “Goal blocked: ”; thread wire includes blocked status.
  • Dependencies

    • Updated pi-goal to 0.3.0.
    • Updated pi-todotools to 0.2.0.

Written for commit 01144db. Summary will update on new commits.

Review in cubic

@code-yeongyu
code-yeongyu merged commit 74c802a into main Jul 26, 2026
6 checks passed
@code-yeongyu
code-yeongyu deleted the feat/goal-todo-resync branch July 26, 2026 10:27
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.

1 participant