Commit Graph
615 Commits
Author SHA1 Message Date
Dudu-0223 11c02855e1 Merge master into subagent runtime stack base 2026-10-29 17:55:40 +08:00
Magolorand_Kerman fcca540841 refactor(session): unify runtime projection reads (#7347)
* refactor(session): bind runtime projection reads to one session

* refactor(session): expose session-bound readers on projection handles

---------

Co-authored-by: _Kerman <[email protected]>
2026-10-27 09:50:22 +00:00
Dudu-0223 b3d4933f39 refactor(subagent): own live lineage outside core agent registry 2026-10-23 16:07:11 +08:00
Dudu-0223 3dde36b5bb Merge master while preserving subagent lifecycle changes 2026-10-23 15:41:00 +08:00
Dudu-0223 871a2bab84 Merge remote-tracking branch 'origin/master' into refactor/agent-team-named-subagents 2026-10-23 15:20:02 +08:00
Dudu-0223 30650824c9 Merge latest master and refresh persistence catalog 2026-10-23 14:55:33 +08:00
Dudu-0223 b096659245 fix(session): make ordinary forks independent of source lineage 2026-10-23 14:48:07 +08:00
mektpoy 6b9f7fcaa7 test(agent-loop): pin the unchanged-text series start in a recorded session
Add an authored headless scenario that appends a changed prompt and then replaces a surface node before the third step. The unchanged-rendering series start must keep both prompt versions and write no system/message event; the scenario fails against the pre-fix projection. Also tighten the tool-series-start assertions and make the prefix premise explicit.
2026-10-23 14:06:08 +08:00
mektpoy 2676c67f32 fix(agent-loop): keep the prompt prefix at a series start with unchanged text
An in-history route carries prompt updates as later system nodes while node 0 stays stale. A surface replacement (compaction, tool-result prune, image offload) starts a new request series, and the projection used to re-baseline node 0 even when the rendering already matched the latest surviving node: it emptied that node and wrote identical text into node 0, so the request differed at its first message and the provider prefix cache missed from the first token (#6973).

Re-baseline node 0 only when the effective text must move: an incapable route, an empty rendering, or a series start whose latest surviving non-empty node differs from the rendering. A capable series start with matching text emits no system event; the loop still logs the request series and rebuilds declarations. Retry compaction still folds the prompt to the head when it shadows the latest node.
2026-10-22 21:25:29 +08:00
mektpoy 71d5454904 test(agent-loop): reproduce series-start prompt rewrite on unchanged text
A compaction replacement after an appended in-history prompt starts a new request series, and the projection folds the prompt back into node 0 although the effective text is unchanged. The request moves the system segment to wire message 0, so the provider prefix cache misses from the first token (#6973).

The regression fails before the fix: the third request carries one system text ("prompt two") instead of keeping the appended node behind the cached prefix.
2026-10-22 21:19:24 +08:00
Dudu-0223 16ece34568 Merge master into subagent tree branch 2026-10-22 13:33:16 +08:00
Dudu-0223 89e2a525aa refactor(subagent): distinguish runtime ownership from Team identity 2026-10-22 11:59:09 +08:00
Yichen Jiang ce24d53eb5 Merge remote-tracking branch 'origin/master' into worktree/dynamic-tool-activation-pr-64796e 2026-10-21 23:32:43 +08:00
Yichen Jiang 207b30d299 Merge remote-tracking branch 'origin/master' into worktree/dynamic-tool-activation-pr-64796e
# Conflicts:
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	packages/core/agent-loop/src/agent.ts
#	packages/core/agent-loop/src/tool-calls.ts
#	packages/core/agent-loop/tests/tool-updates.spec.ts
#	packages/core/system-prompt/README.i18n.yaml
#	packages/core/system-prompt/README.md
#	packages/core/system-prompt/README.zh.md
#	packages/core/tool-executor-ptc/src/ptc.ts
#	packages/core/tool-executor-ptc/tests/ptc.spec.ts
#	packages/core/tools/README.i18n.yaml
#	packages/core/tools/README.md
#	packages/core/tools/README.zh.md
#	packages/core/tools/src/index.ts
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/plan/plan-mode/tests/plan-mode.spec.ts
#	snapshots/session/cordis-inspect-jsdoc/session.v4.jsonl
2026-10-21 23:32:15 +08:00
_Kerman 04609dc0de Merge xtr/session-store-write-lifecycle into xtr/agent-initialization-flow 2026-10-21 19:33:26 +08:00
_Kerman fef2f3d06e Merge master into xtr/session-store-write-lifecycle 2026-10-21 19:27:56 +08:00
_Kerman 46fdc70d66 Merge master into xtr/session-store-write-lifecycle 2026-10-21 19:27:56 +08:00
_Kerman 0e7b3701cb Merge xtr/session-store-write-lifecycle into xtr/agent-initialization-flow 2026-10-21 18:22:35 +08:00
_Kerman a53ecb2f3a Merge origin/master into xtr/tool-executor-plugins 2026-10-21 15:56:44 +08:00
Yichen Jiang 9d0c97b9d2 feat(tools): admit conditional tools per step
ctx.tools.register(definition, { when }) adds a synchronous or asynchronous
condition. AgentLoop resolves conditions once per proposed step with the
agent, the model selection that step preparation captured, and the turn
signal, before prompt assembly and agent/pre-step. The resulting
ResolvedToolSet governs tool declarations, Native dispatch, PTC bindings,
and nested calls for that step and its retries, and the turn disposes it
when the proposal is rejected or fails, when no step opens, and after the
step. A false condition removes the tool everywhere; a thrown condition
ends the turn with TOOL_ACTIVATION_FAILED. Calls whose registration was
replaced or removed during the step return UNKNOWN_TOOL.

system-prompt/assemble now transforms PromptPresentation without a tool
array, so tool declarations stay provider-owned. exit_plan_mode is declared
only for steps whose selected plan state is active, the same state that
renders plan guidance; it still rejects a call before the selection is
logged.

Model selection stays as master defines it; this change adds no model
selection event or Agent field.
2026-10-21 15:02:29 +08:00
_Kerman d6dc8890b9 Merge github/master into xtr/session-store-write-lifecycle 2026-10-21 15:01:22 +08:00
_Kerman 8f0489dc06 Merge github/master into xtr/session-store-write-lifecycle 2026-10-21 15:01:22 +08:00
_Kerman 6bfe05c6f5 refactor(agent): name captured step selection modelSelection 2026-10-21 14:08:11 +08:00
_Kerman e727a3b161 fix(tools): keep executor changes out of registry notifications 2026-10-21 12:13:57 +08:00
_Kerman cdb3a76b6a test(agent): complete model ownership migration coverage 2026-10-21 10:43:20 +08:00
_Kerman 7289bee231 test(agent-loop): assert rollback closes before rejection 2026-10-20 22:39:38 +08:00
_Kerman bf4ab8be26 refactor(agent-loop): unify agent initialization 2026-10-20 22:21:52 +08:00
_Kerman 200dedd494 chore: trim unrelated model-selection changes 2026-10-20 22:13:30 +08:00
_Kerman a9c006f9c3 refactor(agent): own model selection on each agent 2026-10-20 21:09:09 +08:00
_Kerman 8b79a1ddcc Merge origin/master into xtr/session-model-selection 2026-10-20 17:22:59 +08:00
_Kerman cc0e980e48 fix(session): align store-owned writes with lifecycle notifications 2026-10-20 11:33:44 +08:00
_Kerman 49a7a75d75 fix(session): align store-owned writes with lifecycle notifications 2026-10-20 11:33:44 +08:00
_Kerman 7d0301fe05 Merge master into scoped tool executors 2026-10-19 21:53:41 +08:00
_Kerman e9784c073b fix(tools): settle executor calls after unload and validate configuration 2026-10-19 16:32:29 +08:00
_Kerman 3b978adcec test(tools): tidy migrated fixture imports and comments 2026-10-19 16:32:04 +08:00
_Kerman ef9ed3fec1 test(agent-loop): preserve context after partial batch failure 2026-10-19 15:24:06 +08:00
_Kerman 31a49c6629 Merge remote-tracking branch 'origin/master' into xtr/tool-executor-plugins
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/tool-catalog.i18n.yaml
#	packages/bundle/base/package.json
#	packages/core/agent-loop/tests/serial-listener-review.spec.ts
#	packages/core/agent-tool-presentation/package.json
#	packages/experimental/auto-review/tests/auto-review.spec.ts
#	packages/lsp/tool-lsp/package.json
#	packages/subagent/tool-subagent/tests/list-models.spec.ts
#	scripts/check-workspace-constraints.ts
#	scripts/type-equiv.manifest.json
#	tsconfig.base.json
2026-10-19 14:53:33 +08:00
_Kerman 455686626d refactor(tools): separate scoped executors from tool registration 2026-10-19 14:49:55 +08:00
_Kerman c18f5bd3c0 Merge remote-tracking branch 'origin/master' into xtr/session-model-selection
# Conflicts:
#	docs/capability-seams.i18n.yaml
#	docs/capability-seams.md
#	docs/capability-seams.zh.md
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/event-producer-consumer.md
#	docs/event-producer-consumer.zh.md
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	docs/persistence-catalog.i18n.yaml
#	docs/persistence-catalog.md
#	docs/persistence-catalog.zh.md
#	docs/persistence-schema.json
#	packages/api/session-controller/src/types.ts
#	packages/bundle/base/package.json
#	packages/bundle/headless/README.i18n.yaml
#	packages/bundle/headless/README.md
#	packages/bundle/headless/README.zh.md
#	packages/bundle/headless/package.json
#	packages/bundle/headless/tsconfig.json
#	packages/subagent/tool-subagent/tests/model-selection-settings.spec.ts
#	scripts/type-equiv.manifest.json
2026-10-19 11:30:55 +08:00
_Kerman 955e600031 Merge master into session projection registration handles 2026-10-19 11:21:16 +08:00
_Kerman 1ec77846bb test(agent-loop): cover configured resume effort and missing route
A config-driven resume applies an explicit configured effort, and an
agent entry without a complete route keeps the recorded selection.
2026-10-16 17:07:37 +08:00
_Kerman 7b112942ab refactor(agent-model): move Session model selection into its own package
Add @deepseek-ai/dsh-agent-model. It provides ctx.agentModel
(resolveForNextStep, select, applyConfiguredRoute) and owns the
modelSelection projection, which the Agent registry no longer registers.
dsh-agent-loop now injects agentModel; the base and SDK-minimal bundles
and the Python SDK runtime include it.

The provider keeps the projection registered until consumers that are
still unloading finish their cleanup. The model-switch notice becomes an
opt-in per-Agent plugin at @deepseek-ai/dsh-agent-model/notice, and
agent/request now also rejects reasoning-effort changes after step
preparation.

Mount the provider in every composition that loads dsh-agent-loop, and
update consumers, the switch-notice snapshot driver, docs, and the
upgrade guide.
2026-10-16 15:28:59 +08:00
_Kerman b015d18e81 fix(agent-loop): identify rejected request route changes 2026-10-16 10:16:18 +08:00
_Kerman e39b5f58c2 refactor(agent): persist model selection in session state 2026-10-15 19:05:09 +08:00
_Kerman c3efd4bff8 refactor(session-projection): keep state reads inside owning services 2026-10-15 18:18:58 +08:00
Dudu-0223 8fa8e9167d refactor(subagent): separate model discovery and session authorization 2026-10-13 11:42:31 +08:00
_Kerman f8a84280aa Merge remote-tracking branch 'origin/master' into xtr/session-projection-registration-handles 2026-10-13 11:27:47 +08:00
Dudu-0223 48ab8620d9 Merge master and align SDK resume fixture with persistence plugin exports 2026-10-12 15:06:12 +08:00
_Kerman 5ecf33aab1 refactor(session-projection): acquire retained readers during activation 2026-10-12 12:03:36 +08:00
turtle1999 dfca3c3c6f fix(session): use namespace exports for JSONL persistence plugin 2026-10-09 15:10:49 +08:00