Commit Graph

314 Commits

Author SHA1 Message Date
Tianyi Cui
a9a9d40cb1 Merge branch 'codex/commands' into codex/goal-commands
# Conflicts:
#	docs/config-catalog.md
#	docs/module-graph.md
#	examples/acp-agent/tests/snapshots/error-finish/stdout.expected.jsonl
#	packages/examples/acp-demo/README.md
#	packages/examples/acp-demo/src/index.ts
#	packages/examples/agent-spine-demo/README.md
#	packages/examples/agent-spine-demo/package.json
#	packages/examples/agent-spine-demo/src/index.ts
2026-07-20 23:10:33 +08:00
Tianyi Cui
f98f0e9838 Merge branch 'codex/goal-tools' into codex/goal-session
# Conflicts:
#	docs/cordis-catalog/events.md
#	docs/event-producer-consumer.md
#	packages/core/agent-loop/README.md
#	packages/core/agent/README.md
2026-07-20 22:57:14 +08:00
Tianyi Cui
5c301febbf Merge branch 'codex/commands' into codex/goal-commands
# Conflicts:
#	docs/architecture.md
#	docs/config-catalog.md
#	docs/cookbook/extension-cookbook.i18n.yaml
#	docs/module-graph.md
#	packages/examples/README.md
#	packages/examples/agent-spine-demo/README.md
#	packages/examples/stdio-demo/README.md
#	packages/examples/stdio-demo/src/index.ts
#	packages/examples/stdio-demo/tests/stdio-agent.spec.ts
2026-07-20 22:18:20 +08:00
Tianyi Cui
cc2e14f76e fix: close recovery review gaps 2026-07-20 22:11:26 +08:00
Tianyi Cui
41196b7e4f Merge branch 'codex/goal-tools' into codex/goal-session
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-20 21:55:13 +08:00
Tianyi Cui
8c12f8945e Merge latest master into codex/llm-error-recovery-rfc
# Conflicts:
#	docs/architecture.md
#	docs/config-catalog.md
#	docs/cordis-catalog/events.md
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	docs/persistence-catalog.md
#	packages/cordis/tool-cordis/src/api-catalog.ts
#	packages/core/agent-loop/src/loop.ts
#	packages/core/agent/src/types.ts
#	packages/examples/agent-spine-demo/README.md
#	packages/examples/stdio-demo/README.md
#	packages/examples/stdio-demo/src/index.ts
#	packages/llm/llm-deepseek/README.md
#	packages/llm/llm-deepseek/src/adapter.ts
#	packages/llm/llm-deepseek/tests/adapter.spec.ts
#	packages/llm/llm/README.md
#	packages/llm/llm/src/error.ts
#	packages/llm/llm/tests/service.spec.ts
#	packages/sandbox/sandbox-policy/tsconfig.json
#	packages/ui/stdio/README.md
#	packages/ui/stdio/src/index.ts
#	packages/ui/stdio/tests/stdio.spec.ts
#	packages/ui/tui/src/index.ts
#	pnpm-lock.yaml
#	website/zh-CN/api/harness/events.md
#	website/zh-CN/api/harness/llm.md
2026-07-20 20:59:11 +08:00
Tianyi Cui
d121f87def Merge branch 'codex/commands' into codex/goal-commands
# Conflicts:
#	.agents/notes/implemented/feature/2026-06-30-interception-seams.md
#	docs/core-data-structures/core.md
#	examples/acp-agent/tests/snapshots/advanced-toolchain/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/advanced-toolchain/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/both-mode-turn/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/both-mode-turn/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/code-mode-turn/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/model-switching/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/permission-switching/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/skill-load/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/text-turn/tool-schemas.expected.json
#	examples/acp-agent/tests/snapshots/workspace-edit/system-prompt.expected.md
#	examples/acp-agent/tests/snapshots/workspace-edit/tool-schemas.expected.json
2026-07-20 20:55:50 +08:00
Tianyi Cui
eb5ae54a79 Merge branch 'codex/goal-tools' into codex/goal-session
# Conflicts:
#	.agents/notes/implemented/feature/2026-07-19-persisted-same-session-goal-domain.i18n.yaml
#	docs/cordis-catalog/events.md
#	docs/core-data-structures/core.md
#	docs/event-producer-consumer.md
#	docs/module-graph.md
#	examples/package.json
#	packages/core/agent/README.md
#	packages/core/agent/src/types.ts
#	website/zh-CN/api/harness/events.md
2026-07-20 20:35:15 +08:00
Tianyi Cui
a86b4c19f5 Merge remote-tracking branch 'origin/master' into codex/remove-stdio-agent
# Conflicts:
#	docs/config-catalog.md
#	docs/event-producer-consumer.md
#	packages/core/agent-loop/tests/config-session-id.spec.ts
#	packages/ui/stdio/README.md
#	packages/ui/stdio/src/index.ts
#	packages/ui/stdio/tests/stdio.spec.ts
2026-07-20 20:29:08 +08:00
Tianyi Cui
710c62474a Merge branch 'master' into fetch-failed-diagnostics 2026-07-20 20:10:57 +08:00
Tianyi Cui
2191d45ece Merge origin/master into codex/remove-stdio-agent
# Conflicts:
#	examples/repl-agent/cordis.yml
2026-07-20 19:58:40 +08:00
Tianyi Cui
4cadf096ce Remove the stdio agent 2026-07-20 19:26:04 +08:00
Tianyi Cui
3293d56a06 fix: clarify provider retry delay contract 2026-07-20 18:38:22 +08:00
Tianyi Cui
8e95f305b0 refactor(agent-loop): reuse loaded session metadata 2026-07-20 18:26:19 +08:00
Tianyi Cui
51ba53766e Merge remote-tracking branch 'origin/master' into fix/subagent-depth-budget
# Conflicts:
#	docs/persistence-catalog.md
2026-07-20 18:11:59 +08:00
Tianyi Cui
ec0a2bb623 Merge origin/master into codex/send-one-turn
# Conflicts:
#	docs/cordis-catalog/events.md
#	docs/event-producer-consumer.md
#	docs/persistence-catalog.md
#	packages/core/agent-loop/src/loop.ts
#	packages/core/agent/README.md
#	website/zh-CN/api/harness/events.md
2026-07-20 17:41:06 +08:00
Turtle
ccb1d09850 Merge remote-tracking branch 'origin/master' into fetch-failed-diagnostics
# Conflicts:
#	docs/event-producer-consumer.md
2026-07-20 17:21:43 +08:00
Tianyi Cui
2d345b5882 Merge remote-tracking branch 'origin/master' into fix/subagent-depth-budget
# Conflicts:
#	docs/cordis-catalog/services.md
#	docs/persistence-catalog.md
#	website/zh-CN/api/harness/sessions.md
2026-07-20 17:14:24 +08:00
Turtle
f593ef5ab5 fix(session): drop the <context> envelope and project context verbatim
context/message previously defaulted to a <context source="…">…</context>
wrapper. No model is trained on a <context> tag either, and message
framing does not belong on the session surface: the surface projects the
durable log, and a caller that wants a frame formats its own content —
which the one heavy producer (workspace-context) already does with its own
<system-reminder> frame, opting out via 'raw'. The tag only added
machinery — ContextEnvelope plus an envelope field threaded through
InjectOptions, HookContext, the context/message event, and the agent-loop
inject/additionalContexts plumbing.

context/message now projects its content verbatim as a user-role message,
sharing one deriveEventMessage case with user/message and steering/message.
ContextEnvelope and every envelope field are removed; context/message.meta
still carries durable, model-hidden JSON state. Regenerated catalogs and
website API; refreshed the three affected keyless snapshots (envelope field
only; timestamps unchanged).

Broadens and renames the steering Agent Note to cover both envelope
removals as one decision.

Agent Note: .agents/notes/implemented/simplification/2026-07-20-unwrap-injected-content-envelopes.md
2026-07-20 16:22:20 +08:00
Yichen Jiang
f2a813b791 Merge remote-tracking branch 'origin/master' into fix/subagent-depth-budget 2026-07-20 15:15:31 +08:00
pku-xht
c16e1078f5 docs(agent): clarify late steering timing 2026-07-20 14:42:55 +08:00
pku-xht
7d7d69e225 review fix: cover post-cancel replacement 2026-07-20 13:20:51 +08:00
pku-xht
da70e47048 review fix: preserve idle waiter quiescence 2026-07-20 13:15:11 +08:00
pku-xht
d59149a221 review fix: restore idle after between-turn cancellation 2026-07-20 12:51:44 +08:00
Turtle
aeb48cc5f3 Render error cause chains at every diagnostic seam
A TUI run against an unreachable endpoint failed with only 'fetch failed':
undici wraps transport failures in a bare TypeError whose diagnosis lives
on .cause, and every diagnostic seam rendered only error.message. The
readline front door additionally rendered failed turns as pure silence.

- dsh-llm: new errorChain(value) renders the full cause chain and
  AggregateError members with circular/hostile-coercion containment.
- llm-deepseek: pre-response transport failures throw LlmError('NETWORK')
  naming the endpoint and chaining the fetch TypeError; aborts keep their
  DOMException so the loop still classifies them as cancellation.
- agent-loop: durable turn/end error messages and logger warnings render
  through errorChain; local renderThrown copies removed.
- ui-stdio: failure turn/end reasons now render ([turn failed <code>],
  [turn aborted], [turn rejected], output-token-limit); startup-failure
  logs use errorChain.
- ui-tui: agent/error notices and the startup-failure line use errorChain.
2026-07-20 12:35:10 +08:00
pku-xht
a6e96c47f3 review fix: pin ordinary-send batching removal 2026-07-20 11:53:49 +08:00
pku-xht
0891465ee0 Merge origin/master into codex/send-one-turn 2026-07-20 11:52:30 +08:00
Tianyi Cui
3b0b0cefeb feat: implement bounded LLM request recovery 2026-07-20 03:34:19 +08:00
Tianyi Cui
fdce57cf4a Merge codex/commands into codex/goal-commands 2026-07-20 01:43:32 +08:00
Tianyi Cui
b21193ded5 Merge codex/goal-tools into codex/goal-session 2026-07-20 01:21:40 +08:00
Tianyi Cui
207692bc16 feat(goal): add human goal command 2026-07-19 23:55:33 +08:00
Tianyi Cui
e8eddc7ef8 Rename RFCs to Agent Notes 2026-07-19 22:52:03 +08:00
Tianyi Cui
adc350eba2 Merge remote-tracking branch 'origin/codex/goal-tools' into codex/goal-session 2026-07-19 22:33:34 +08:00
Tianyi Cui
546f2ae478 Merge remote-tracking branch 'origin/master' into codex/rename-golden-files-to-expected 2026-07-19 21:09:20 +08:00
Tianyi Cui
25555c9cfc feat(goal): drive same-session goal rounds 2026-07-19 20:30:43 +08:00
Tianyi Cui
a278374e8f docs: structure model experience fields 2026-07-19 18:08:42 +08:00
Tianyi Cui
0893aaa7cb test: rename golden snapshot files to expected 2026-07-19 17:45:49 +08:00
Yichen Jiang
b0dc299508 Merge remote-tracking branch 'origin/master' into fix/subagent-depth-budget
# Conflicts:
#	examples/acp-agent/tests/acp.snapshot.ts
2026-07-19 17:42:52 +08:00
Tianyi Cui
bcc920369c docs: document package KV cache effects 2026-07-19 17:39:50 +08:00
Yichen Jiang
d614374ac6 Merge branch 'master' into fix/subagent-depth-budget 2026-07-19 17:24:24 +08:00
Yichen Jiang
0d00106fa8 fix(session): persist the delegation depth in the session header
A subagent child's recursion depth lived only in runtime AgentOptions,
so a persisted child came back from resume counted as top-level and
maxDepth stopped binding after every restart. Add
SessionHeader.delegationDepth, round-trip it through the JSONL and
SQLite backends (SQLite schema v5), restore it on agent-loop resume,
and write it when the in-process backends create a child. The seam now
owns the shared depth vocabulary (delegationDepthOf): the persisted
header is authoritative and monotone — runtime options may deepen it
but never lower it.
2026-07-19 17:20:36 +08:00
Tianyi Cui
20fd7133a0 Merge latest master into post-step recovery
Adopt initiator-derived private loop and session plumbing while preserving post-step recovery and balanced synthetic tool-call results after cancellation.

Keep the architecture map within its existing budget while documenting ambient Agent ownership and explicit cross-boundary identities.
2026-07-19 17:02:55 +08:00
Tianyi Cui
fd54b5c848 Merge latest master into post-step recovery
Combine agent initiator scoping and exact Cordis JSDoc inspection with post-step compaction and bounded request recovery.

Regenerate the Cordis and website API catalogs, and classify the recovery and compaction types required by the current catalog link-coverage gate.
2026-07-19 16:46:01 +08:00
Tianyi Cui
5e2607df8c refactor(core): capture session inside loop operations 2026-07-19 16:28:31 +08:00
Tianyi Cui
ee6b9d081a fix(llm): scope adapter failures to model calls
Replace the process-wide adapter-failure WeakSet with a per-call scope bound to the exact AsyncIterable returned by LlmService.stream(). Give every call a unique wrapper so waterfall middleware can reuse an iterable without sharing provenance.

Move agent-loop recovery classification to the model-stream boundary. Only the final adapter behind that exact call can become an agent/request-error; nested llm/stream calls remain ordinary outer middleware failures while preserving the original Error.

Cover nested calls, reused middleware iterables, and end-to-end agent-loop recovery. Update the package and RFC contracts, bilingual pairing record, and generated API and catalog references.
2026-07-19 16:14:58 +08:00
Tianyi Cui
98e224e45e refactor(agent): exhaust recovery and compaction decisions
Dispatch RequestErrorDecision and CompactionTrigger through explicit discriminant switches. End each closed union with assertNever so new variants fail compilation instead of silently inheriting fail or pressure behavior.

This preserves the current retry, fail, pressure, and overflow semantics while aligning the new recovery seams with the repository closed-union contract.
2026-07-19 15:02:11 +08:00
Tianyi Cui
7a9c2ef473 docs(core): state loop initiator precondition 2026-07-19 14:20:27 +08:00
Tianyi Cui
4284cf70e4 Merge remote-tracking branch 'origin/worktree/agent-execution-context-rfc' into codex/simplify-agent-identity-plumbing
# Conflicts:
#	docs/rfc/implemented/architecture/2026-07-15-agent-initiator-scope.i18n.yaml
#	docs/rfc/implemented/architecture/2026-07-15-agent-initiator-scope.md
#	docs/rfc/implemented/architecture/2026-07-15-agent-initiator-scope.zh.md
2026-07-19 14:18:58 +08:00
Tianyi Cui
f66cde41d1 docs(core): clarify initiator restoration timing 2026-07-19 14:16:07 +08:00
Tianyi Cui
f21ed1bfa0 refactor(core): use initiator in loop internals 2026-07-19 14:06:47 +08:00