Turtle
d613fdb073
fix(agent-loop): third review pass — disposal discard ordering, flush guard, docs
...
Address a fresh-eye review of the disposal/injection fixes:
- disposal now snapshots, clears, and marks disposed BEFORE emitting
agent/inbox/discard (mirroring cancel's snapshot→clear→emit), so a
re-entrant send/cancel from a discard listener throws 'disposed' or
finds an empty inbox instead of leaking or double-discarding an id.
The discard is unconditional (even on unpublished setup-rollback) to
match send's unconditional enqueue, keeping every id balanced.
- restore the turnRecorded guard on the idle-injection flush: a
turn/start rejected pre-commit (append reentrancy / internal-dispatch
veto) records nothing and owes no flush; the previous unconditional
flush emitted a phantom-turn agent/error. The isTurnOpen/turnRecorded
branches are reachable (reentrant inject from a session/event
listener) and now covered by a regression test rather than v8-ignored.
- rewrite the agent/inbox/discard event JSDoc to enumerate all three
emitters (cancel, terminal turn-stop, disposal) — every enqueued id
gets exactly one terminal dequeue-or-discard.
Per-file coverage stays 100%.
2026-07-24 13:39:06 +08:00
Turtle
c7c1b97501
fix(agent-loop): address second-round review — disposal discard, injection validation, frozen payloads
...
Address the review bot's five genuinely-new findings on the current code:
- disposal now discards any still-pending inbox items before the loop
exits, so every enqueued id gets a terminal lifecycle event.
- injection (next-step/no-wakeup) validates its payload up front, before
opening the idle one-shot turn, honoring 'invalid input throws before
any append'; and rejects attached contexts (which belong only to inbox
messages) rather than silently dropping them.
- agentMessage() freezes the agent/inbox/* payload so a listener cannot
mutate the shared correlation object mid-dispatch.
- refresh the package READMEs (compact, goal, guard, hook-protocol,
plan-mode, time-context, workspace-context) that still referenced the
removed context/message event, with the source-based user/message
distinction.
The up-front injection validation makes two finally branches unreachable
(v8-ignored as the turn-enclosure backstop). Adds regression tests for
disposal discard, context rejection, up-front validation, and the frozen
payload; per-file coverage stays 100%.
2026-07-24 12:05:57 +08:00
Turtle
d5f88f1221
Merge remote-tracking branch 'origin/master' into feat/send-unify
...
# Conflicts:
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
# packages/cordis/tool-cordis/src/api-catalog.ts
# packages/pty/pty-local/tests/index.spec.ts
# packages/session-query/session-query/tests/tracing.spec.ts
2026-07-23 22:41:45 +08:00
Turtle
1f9a3e1bee
fix(agent-loop): second review pass — late-steering discard, dead-branch, catalog leaks
...
Address a second fresh-eye review of the review fixes:
- MAJOR: late steering that lands after runTurn returns terminally
stopped (e.g. during the post-turn flush) was drained by runLoop and
dropped without a discard, leaving a dangling outstanding id the
negative-only invariant can't catch. Emit agent/inbox/discard for it,
symmetric with the in-turn terminal-stop drop.
- remove the dead cancel() idle-settle branch: whenIdle's fast path
already resolves for a lone quiet item, so no waiter is ever left for
it to settle. Document why.
- gen-cordis-api classShape now drops private/protected/#private members
and strips getter/setter bodies, so Session no longer leaks private
fields and getter bodies into the model catalog.
- document that AgentMessage intentionally omits meta (durable-only).
Adds a regression test for the late-steering discard.
2026-07-23 22:33:12 +08:00
Turtle
98ee4ce429
fix(agent-loop): address review — quiet-item parking, meta, discard balance
...
Resolve six review findings on the unified-send change:
- quiet (wakeup:false) queued items no longer un-park the driver; the
inbox distinguishes hasWakingQueued (drives the loop, idle/quiescence)
from hasQueued (anything to dequeue), so a lone quiet item parks at idle
and rides the next waking send. whenIdle/cancel settle off the waking
signal, so cancelling a parked quiet item no longer hangs whenIdle.
- SendOptions.meta on queued/steering sends now reaches the durable
user/message and steering/message (was dropped except on injection).
- a terminal agent/turn-stop that drops pending steering emits
agent/inbox/discard so the enqueue-dequeue-or-discard ledger balances.
- the loop-authored continuation reason is snapshotted and frozen like a
public send.
- gen-cordis-api collects exported classes (body-stripped) so the now-
abstract-class Agent and its transitive shapes reappear in the API
catalog.
Adds regression tests for each and re-records the affected snapshot.
2026-07-23 21:41:42 +08:00
Turtle
a3ad5241ba
Merge remote-tracking branch 'origin/master' into feat/send-unify
...
# Conflicts:
# docs/persistence-catalog.md
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
# packages/context/time-context/tests/time-context.spec.ts
# packages/cordis/tool-cordis/src/api-catalog.ts
2026-07-23 20:54:48 +08:00
Tianyi Cui
26bfd37da0
Merge commit 'refs/codex-unblock/20260723/master' into worktree/pty-review-fixes
...
# Conflicts:
# .agents/notes/implemented/feature/2026-06-30-interception-seams.md
# docs/config-catalog.md
# docs/cordis-catalog/services.md
# docs/core-data-structures/tools.md
# docs/event-producer-consumer.md
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
# packages/cordis/tool-cordis/src/api-catalog.ts
# packages/core/tools/README.md
# packages/core/tools/src/index.ts
# packages/core/tools/src/schema.ts
# packages/core/tools/tests/tools.spec.ts
# packages/pty/tool-pty/README.md
# packages/pty/tool-pty/src/index.ts
# packages/pty/tool-pty/src/render.ts
# packages/tasks/tool-tasks/README.md
# packages/tasks/tool-tasks/src/index.ts
2026-07-23 20:50:45 +08:00
Turtle
866b543700
docs(agent): fix stale 'info' param name in agent/inbox/enqueue JSDoc
...
The @param was renamed info→message; the body sentence still named info.
Found by fresh-eye review. Regenerated the catalog/graph docs.
2026-07-23 20:50:13 +08:00
Turtle
3fd72f7c74
feat(agent): rename InboxItemInfo to AgentMessage with an id; send returns it
...
Add a branded AgentMessageId assigned to each accepted send message and
returned from send/followup/steer/inject (was void). Rename the inbox
event payload InboxItemInfo to AgentMessage, carrying that id so a caller
can correlate a queued item with its enqueue/dequeue/discard events.
2026-07-23 20:45:29 +08:00
Turtle
95e75ba3e0
fix(agent-loop): balance inbox invariant on continuation-reason steer
...
The FIFO-conservation invariant fired on the loop-authored continuation
reason path: a continue-with-reason decision entered the steering FIFO
without an agent/inbox/enqueue, so its later dequeue/discard had no
matching enqueue. Emit the enqueue for that steer too, add a regression
test that mounts the invariant over a continue-with-reason turn and a
cancel, and hoist the duplicated inboxInfo helper into inbox.ts.
Found by fresh-eye review.
2026-07-23 19:37:21 +08:00
Turtle
44fd93fd06
feat(agent): unify send(target × wakeup), coalesce context/message into user/message
...
Replace send/steer/inject with one Agent.send primitive over the
(target × wakeup) matrix; followup/steer/inject become fixed-preset
alias methods on the now-abstract Agent class. Coalesce context/message
into user/message (injected context is a non-user source). Replace
agent/queued with agent/inbox/enqueue/dequeue/discard, add cancel
keepInbox, and add a FIFO-conservation invariant.
2026-07-23 19:15:45 +08:00
Tianyi Cui
43a2c0a0af
fix(tools): avoid duplicate run_code result views
2026-07-23 04:08:27 +08:00
Tianyi Cui
94adb60e1a
fix(tools): preserve bounded fallback guidance
2026-07-23 03:15:15 +08:00
Tianyi Cui
2821826e2c
fix(pty): close final review gaps
2026-07-23 02:53:43 +08:00
Tianyi Cui
77f0f3e632
Merge branch 'codex/code-mode-typed-results' into codex/code-mode-complete-result-card
...
# Conflicts:
# .agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
# .agents/notes/implemented/feature/2026-07-20-code-mode-typed-tool-returns.i18n.yaml
2026-07-23 01:38:52 +08:00
Tianyi Cui
fb74156cf8
fix(code-mode): generalize failures and bound diagnostics
2026-07-23 01:32:17 +08:00
Tianyi Cui
8c1a9b7752
Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
2026-07-23 01:15:13 +08:00
Tianyi Cui
dd9124468f
Merge codex/tool-json-schema-dsl into codex/canonical-tool-output
...
# Conflicts:
# docs/core-data-structures/tools.md
# packages/core/tools/src/schema.ts
2026-07-23 01:08:18 +08:00
Tianyi Cui
e20dea1629
fix(schema): align projected and enforced declarations
2026-07-23 01:05:41 +08:00
Tianyi Cui
d626b2582d
fix(tools): scope canonical provenance to dispatch
2026-07-23 00:39:55 +08:00
Tianyi Cui
e35a419ba8
fix(code-mode): keep deep host boundaries iterative
2026-07-23 00:30:36 +08:00
Tianyi Cui
3f547a83d1
Merge branch 'codex/code-mode-typed-results' into codex/code-mode-complete-result-card
...
# Conflicts:
# .agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
2026-07-23 00:03:56 +08:00
Tianyi Cui
8dbea80294
Merge branch 'codex/canonical-tool-output' into codex/code-mode-typed-results
2026-07-22 23:55:07 +08:00
Tianyi Cui
8d42d3c979
Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
...
# Conflicts:
# docs/config-catalog.md
# docs/persistence-catalog.md
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/session.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
# packages/cordis/tool-cordis/src/api-catalog.ts
# packages/core/agent-loop/tests/contract-regressions.spec.ts
# packages/ui/acp/src/index.ts
# packages/ui/tui/src/index.ts
2026-07-22 23:50:41 +08:00
Tianyi Cui
065d20c249
Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
...
# Conflicts:
# scripts/type-equiv.manifest.json
2026-07-22 23:34:17 +08:00
Tianyi Cui
d5d6960184
Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
...
# Conflicts:
# docs/architecture.i18n.yaml
# docs/module-graph.md
2026-07-22 23:17:02 +08:00
Tianyi Cui
fed32c767d
Merge branch 'codex/tool-json-schema-dsl' into codex/canonical-tool-output
2026-07-22 23:12:20 +08:00
Tianyi Cui
1429c5d22f
Merge remote-tracking branch 'origin/master' into codex/tool-json-schema-dsl
2026-07-22 23:03:02 +08:00
Tianyi Cui
b65afd320a
Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
...
# Conflicts:
# docs/cordis-catalog/events.md
# docs/cordis-catalog/services.md
# docs/event-producer-consumer.md
2026-07-22 23:00:05 +08:00
Tianyi Cui
d1564f062b
Merge refreshed typed Code Mode results into result card fix
2026-07-22 22:54:55 +08:00
Tianyi Cui
cf5dfe46e7
Merge remote-tracking branch 'origin/rfc/pty' into worktree/pr467-retarget-latest-master
2026-07-22 22:50:55 +08:00
Tianyi Cui
d92bb12963
Merge refreshed canonical outputs into typed Code Mode results
2026-07-22 22:50:28 +08:00
Tianyi Cui
3d9240e423
Merge refreshed schema DSL into canonical tool outputs
2026-07-22 22:46:10 +08:00
Tianyi Cui
d99094b1ac
Merge updated rfc/pty into feature/persistent-pty-sessions
...
# Conflicts:
# docs/architecture.i18n.yaml
# docs/core-data-structures/core.md
# pnpm-lock.yaml
# scripts/gen-cordis-catalog.ts
2026-07-22 22:43:20 +08:00
Tianyi Cui
c51c02cafa
Merge latest master into schema DSL
2026-07-22 22:42:43 +08:00
Tianyi Cui
59e325f571
Merge refreshed typed Code Mode results into result card fix
2026-07-22 22:38:23 +08:00
Tianyi Cui
e962642926
Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
...
# Conflicts:
# docs/architecture.i18n.yaml
# docs/config-catalog.md
# docs/event-producer-consumer.md
# docs/module-graph.md
# packages/examples/acp-demo/README.md
# packages/examples/acp-demo/src/index.ts
# packages/examples/acp-demo/tests/built-bin.e2e.ts
# packages/examples/tui-demo/package.json
# packages/examples/tui-demo/src/index.ts
# packages/examples/tui-demo/tests/tui-agent.spec.ts
2026-07-22 22:38:17 +08:00
Tianyi Cui
b0f5d9e313
Merge commit 'refs/codex-unblock/20260722-pr338-master' into HEAD
...
# Conflicts:
# docs/event-producer-consumer.md
# examples/acp-agent/tests/acp.snapshot.ts
# packages/core/session/src/index.ts
# packages/examples/acp-demo/src/index.ts
# packages/session-persistence/session-persistence-jsonl/src/format.ts
# vitest.config.ts
2026-07-22 22:37:16 +08:00
Tianyi Cui
101fcdd319
Merge refreshed canonical outputs into typed Code Mode results
...
# Conflicts:
# docs/event-producer-consumer.md
2026-07-22 22:34:52 +08:00
Tianyi Cui
8930a63b18
Merge refreshed schema DSL into canonical tool outputs
...
# Conflicts:
# docs/event-producer-consumer.md
2026-07-22 22:28:50 +08:00
Tianyi Cui
93263ed519
Merge latest master into schema DSL
...
# Conflicts:
# docs/event-producer-consumer.md
2026-07-22 22:21:50 +08:00
Tianyi Cui
e51b2fd834
Merge refreshed typed Code Mode results into result card fix
...
# Conflicts:
# .agents/notes/implemented/architecture/2026-07-20-canonical-tool-output-contract.i18n.yaml
# .agents/notes/implemented/feature/2026-07-20-code-mode-typed-tool-returns.i18n.yaml
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
# examples/tui-agent/tests/snapshots/code-mode/terminal.expected.txt
2026-07-22 22:17:05 +08:00
Tianyi Cui
ce970bd31c
Merge refreshed canonical outputs into typed Code Mode results
...
# Conflicts:
# docs/module-graph.md
# examples/acp-agent/tests/snapshots/advanced-toolchain/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/both-mode-turn/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/code-mode-turn/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/session.jsonl
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/system-prompt.expected.md
# packages/core/tools/src/ts-types.ts
2026-07-22 21:49:35 +08:00
Tianyi Cui
54bc084e5d
Merge refreshed schema DSL into canonical tool output
...
# Conflicts:
# docs/config-catalog.md
# examples/headless-agent/tests/snapshots/advanced-toolchain/session.1.jsonl
# examples/headless-agent/tests/snapshots/advanced-toolchain/session.2.jsonl
# examples/headless-agent/tests/snapshots/advanced-toolchain/session.jsonl
# packages/context/workspace-context/tests/workspace-context.spec.ts
# packages/core/tools/tests/tools.spec.ts
# packages/ui/tui/src/index.ts
# packages/ui/tui/tests/tui.snapshot.ts
2026-07-22 21:31:16 +08:00
Tianyi Cui
c848c7b15e
Merge refreshed rfc/pty into feature/persistent-pty-sessions
...
# Conflicts:
# docs/architecture.md
# docs/capability-seams.md
# docs/config-catalog.md
# docs/cordis-catalog/services.md
# docs/module-graph.md
# docs/tool-catalog.md
# examples/acp-agent/tests/acp.snapshot.ts
# examples/headless-agent/tests/headless.snapshot.ts
# examples/package.json
# packages/README.md
# packages/cordis/tool-cordis/src/api-catalog.ts
# packages/core/tools/tests/gen-tool-catalog.spec.ts
# pnpm-lock.yaml
# pnpm-workspace.yaml
# scripts/gen-tool-catalog.ts
# scripts/type-equiv.manifest.json
# website/.vitepress/config/api-sidebar.json
2026-07-22 21:12:16 +08:00
Tianyi Cui
6613f43178
Merge remote-tracking branch 'origin/master' into worktree/pr468-retarget-latest-master
...
# Conflicts:
# docs/architecture.i18n.yaml
# docs/capability-seams.md
# docs/config-catalog.md
# docs/event-producer-consumer.md
# docs/module-graph.md
# examples/acp-agent/tests/goal-snapshots/goal-session/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/advanced-toolchain/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/bash-spill/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/both-mode-turn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/cancel-tool-calls/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/cancel/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/code-mode-turn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/config-options/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/cordis-inspect-jsdoc/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/error-finish/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/escalation-approved/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/escalation-rejected/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-edit/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-escalation-approved/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-policy-reject/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-read-window/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-read/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-terminal-card/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-write-overwrite/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/fs-write/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/goal-command-status/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/handshake/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-posttool-block/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-posttool-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-pretool-ask/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-pretool-deny/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-promptsubmit-block/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-promptsubmit-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-cc-stop-continue/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-posttool-block/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-posttool-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-pretool-block/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-promptsubmit-block/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-promptsubmit-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/hook-codex-stop-continue/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/lsp-definition/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/model-switching/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/multi-turn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/parallel-tool-calls/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/permission-switching/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/repeat-tool-guard/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/skill-load/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/subagent-depth-two-rejection/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/subagent-fork/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/subagent-mixed/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/subagent-multi/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/subagent-spawn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/text-turn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/todo-plan/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/tool-call-turn/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/workflow-run/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/workspace-context/stdout.expected.jsonl
# examples/acp-agent/tests/snapshots/workspace-edit/stdout.expected.jsonl
# packages/ui/acp/acp-feature-support.md
# packages/ui/acp/src/index.ts
# packages/ui/acp/tests/harness.ts
# packages/ui/tui/README.md
# scripts/type-equiv.manifest.json
2026-07-22 21:06:50 +08:00
Tianyi Cui
c8389ccecf
Merge latest master into tool JSON schema DSL
...
# Conflicts:
# examples/acp-agent/tests/snapshots/advanced-toolchain/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/both-mode-turn/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/code-mode-turn/system-prompt.expected.md
# examples/acp-agent/tests/snapshots/code-mode-workspace-context/system-prompt.expected.md
2026-07-22 20:58:17 +08:00
Tianyi Cui
34194f0cd5
fix(tools): make schema traversal stack-safe
2026-07-22 20:51:13 +08:00
Tianyi Cui
2478ef7d6d
Merge master into worktree/semantic-session-checkpoints
2026-07-22 20:50:46 +08:00
Tianyi Cui
994bb4b07c
fix(code-mode): render deep results iteratively
2026-07-22 19:57:44 +08:00