Commit graph

2092 commits

Author SHA1 Message Date
Chinesezjc
6f58f9c336 fix(code-runtime-python): pace concurrent binding replies against fd 3
`sendReply` ignored `proto.write`'s `false` return, so a program resolving
several large values in one `asyncio.gather` round encoded every reply in the
same turn and queued all of them in fd 3's writable buffer. Binding resolution
carries no seam-level byte cap to bound that, and the failure kills the host
process rather than failing the run: measured on a 64 KiB-highWaterMark pipe,
eight 4 MiB replies buffered 32.0 MiB at once against 0.0 MiB once paced.

Replies now go through a queue that encodes and writes one frame at a time,
awaiting `drain` when the pipe is full. The encode happens inside the loop, so a
queued reply the run no longer needs is dropped by the `settled` check without
ever being serialized.

This was previously deferred on the grounds that serializing would narrow the
seam's concurrency contract. That reasoning was wrong: the child matches each
reply to its `call` by id from a pump that reads fd 3 continuously, so arrival
order was never observable, and the bindings still run concurrently. Only the
host's peak memory and the flush timing change. The README entry recording the
deferral is removed and the Agent Note records the mechanism instead.
2026-08-31 14:33:31 +08:00
Chinesezjc
9d9525549d fix(code-runtime-python): raise the output-budget worst-case multiple to 12 and reject the boundary
The load-time output-budget/addressSpaceMb gate used a worst-case multiple of 8,
assuming two simultaneous ~4x astral copies (the built string and its encode).
Three are live at the peak: on the newline path a single write holds the caller's
text argument, the line slice handed to push, and push's encode copy; the
settlement flush_line path held the pending chunks, their join, and that encode
copy. A budget admitted at 8x (e.g. maxLogBytes 48 MiB against addressSpaceMb 512)
could still OOM the child. The multiple is now 12, the strict `>` is `>=` so a
budget whose peak exactly equals the room left after the interpreter baseline is
rejected (that peak plus the baseline is the whole address space), and flush_line
drops the pending chunks before its push to match the newline path's
join-clear-push order. The child re-check mirror and both note sides move in step;
config-catalog is regenerated from the updated field JSDoc.
2026-08-31 14:22:37 +08:00
Chinesezjc
d9307ae2a4 fix(code-runtime-python): size the output-budget/address-space gate by worst-case Unicode and gate both budgets
The load-time addressSpaceMb gate used a 1/8 fraction derived for ASCII, but the
child ledgers trigger on character count against a serialized-byte budget: an
astral character is one character yet ~4 bytes stored and ~4 encoded, live at
once, so the true worst-case peak is ~8x the budget, not ~2x. Replace the
fraction with an explicit OUTPUT_BUDGET_WORST_CASE_ADDRESS_SPACE_MULTIPLE (8)
and a strict `>`, and gate maxValueBytes the same way as maxLogBytes — the value
path builds and encodes a near-budget completion under the same RLIMIT_AS, so
the incompatible pair was previously admitted there too.

Slice the newline branch's unterminated tail to a budget-sized prefix: it
buffered the whole text[pos:] before the flush trigger could bound it, so an
early newline plus a huge tail made a second full copy of the model's string —
an RLIMIT_AS death the config gate cannot cover since the tail can far exceed
maxLogBytes.

Disclose the cross-field constraint in the maxLogBytes/maxValueBytes/addressSpaceMb
JSDoc (regenerating config-catalog); refresh the note's stale
Buffer.byteLength(JSON.stringify) reference; reconcile the arrival-order rebuttal
with the seam's "in order" logs JSDoc (within-stream, cross-stream best-effort).
Extend the load-rejection test to both budgets and add a tail-copy regression;
sync the zh pair.
2026-08-31 14:22:37 +08:00
Chinesezjc
a9c480bf39 docs(config-catalog): refresh the code-runtime-python Config source line
Removing the now-unused StringDecoder import shifted the Config interface
down by one line; regenerate the embedded source reference.
2026-08-31 14:22:36 +08:00
Chinesezjc
c388169cff feat(code-runtime-python): add the CPython subprocess backend
Land the PythonCodeRuntime implementation on top of the fd-3 protocol
seam: python3 -I per run, binding namespace over fd 3, RLIMIT_CPU/AS,
wall-clock timer, and SIGTERM->grace->SIGKILL process-group teardown,
with the real-subprocess integration suite.

Fixes three defects surfaced on the source PR's review before they ship:
- boot-write failure resolved a worker-exit through finish()/settle()
  that read wallTimer/onAbort/live in their TDZ, rejecting run() instead;
  the boot write now runs after those bindings and the v8-ignore that hid
  the branch is removed.
- log capture serialized against settlement with no lock while model
  daemon threads keep writing; LogBuffer now owns one shared re-entrant
  lock taken by write/flush_line/push.
- the fd-3 line residual was a subarray view pinning the whole joined
  frame; it is copied into a right-sized Buffer via detachResidual so
  pendingBytes measures what is retained.
2026-08-31 14:14:32 +08:00
Tianyi Cui
4553c9d957 refactor(session)!: remove SQLite persistence backend 2026-08-31 13:23:07 +08:00
Turtle
244de7c18a refactor(bundle): remove the agent spine demo 2026-08-31 11:23:30 +08:00
imccyu
795d8ec985 docs: describe runtime dependency ownership 2026-08-30 02:29:53 +08:00
Dudu-0223
112daedd54 Merge origin/master into perf/3270-linear-stream-queues 2026-08-29 18:59:23 +08:00
imccyu
18480ff902 test(connection): verify and document recovery behavior 2026-08-29 11:18:58 +08:00
imccyu
39a5a1d7e4 chore(docs): regenerate catalogs, graphs, and the message-feedback golden
- gen-cordis-catalog / gen-cordis-inspect-catalog / gen-client-catalog /
  gen-config-catalog / gen-doc-graphs / gen-module-graph outputs pick up
  the converged Remote vocabulary (gateway/* codes, RemoteError JSDoc)
  and the dsh-util-time package; the zh sides of the three
  English-generated pages follow the same line-number shifts.
- the message-feedback protocol golden records the accepted wire
  change: a boundary-validation failure now reports
  gateway/input-invalid with structured details instead of a bare
  internal code.
2026-08-28 22:37:42 +08:00
Dudu-0223
51a6eabb27 perf(api): replace shift-backed stream queues 2026-08-28 17:37:03 +08:00
pku-xht
6c5bb90b48 Merge remote-tracking branch 'origin/master' into schedule-web-catalog 2026-08-28 14:45:30 +08:00
_Kerman
8645053ca0 refactor(goal, permission, plan): require the projection registry 2026-08-28 12:37:17 +08:00
_Kerman
25b0c943ce Merge remote-tracking branch 'github/master' into xtr/session-projection-migrations
# Conflicts:
#	.agents/notes/implemented/architecture/2026-08-04-draft-provider-endpoint-interrogation.i18n.yaml
#	.agents/notes/implemented/architecture/2026-08-04-draft-provider-endpoint-interrogation.md
#	.agents/notes/implemented/architecture/2026-08-04-draft-provider-endpoint-interrogation.zh.md
#	.agents/notes/implemented/feature/2026-08-06-continuable-subagent-interrupt.i18n.yaml
#	.agents/notes/implemented/feature/2026-08-06-continuable-subagent-interrupt.md
#	.agents/notes/implemented/feature/2026-08-06-continuable-subagent-interrupt.zh.md
#	.agents/notes/implemented/process/2026-07-20-gui-testing-system.i18n.yaml
#	.agents/notes/implemented/process/2026-07-20-gui-testing-system.md
#	.agents/notes/implemented/process/2026-07-20-gui-testing-system.zh.md
2026-08-28 10:59:30 +08:00
pku-xht
1a5d004524 Merge commit 'bc954280ae67e349291e51e5787c6987e767fa40' into schedule-web-catalog
# Conflicts:
#	packages/client/ui-workspace/src/client/rows/Rows.tsx
#	tsconfig.base.json
2026-08-28 07:24:24 +08:00
_Kerman
13c1541c63 Merge remote-tracking branch 'github/master' into xtr/session-projection-migrations
# Conflicts:
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	pnpm-lock.yaml
2026-08-27 23:18:55 +08:00
Tianyi Cui
45c514a42b fix: align mode-value prose and stale persistent mentions with the split
The split kept the session-persistent vocabulary (tool/code-dispatch*,
tools-code-mode, :code:) on this PR, but several prose surfaces still named
the new values: the zh persistence/tool catalogs, the renamed Agent Notes'
event mentions, spill-policy comments, and a garbled 're-enPTC mode'
replacement. Also rename the mode value to ptc in the places the rename
missed (tools and agent-tool-presentation READMEs, the Config JSDoc, note
mode unions) and the codeModeHarness* e2e helpers.
2026-08-27 23:14:32 +08:00
Tianyi Cui
3ca9c7d489 rename code-mode to ptc (PTC mode), except session-persistent vocabulary
Rename the tool-presentation transport from code-mode to ptc everywhere
that is not written into session logs: the mode config value becomes 'ptc',
the preset directory/id becomes ptc, the demo becomes demo:ptc, the
dispatch waterfall becomes tools/ptc-dispatch-log (types PtcDispatch*), the
prompt rule becomes tools:ptc-only, source/test files become ptc.ts etc.,
and prose says PTC mode / PTC 模式. The session-persistent vocabulary
(durable events tool/code-dispatch*, logged plugin name tools-code-mode,
sub-call id segment :code:) intentionally stays and moves in the stacked
persistence PR, which is blocked until the SESSION_FORMAT_VERSION v0→v1
migration lands with it. run_code, its code parameter, CodeSdkLanguage,
CodeRunFailedError, the dsh-code-runtime family, third-party codex names,
and frozen archived notes keep their names.
2026-08-27 23:14:31 +08:00
imccyu
e57e7c3f25 docs(api): describe Connection-owned transport 2026-08-27 22:26:30 +08:00
imccyu
18ae39a665 fix(api): preserve native path opening behavior 2026-08-27 21:57:58 +08:00
imccyu
160706be60 test(api): refresh Remote migration artifacts 2026-08-27 21:57:56 +08:00
_Kerman
4b48b2b439 Merge remote-tracking branch 'github/master' into xtr/session-projection-migrations 2026-08-27 17:18:58 +08:00
_Kerman
6717cb8d19 refactor(session): trim projection migration diff 2026-08-27 17:18:51 +08:00
_Kerman
d9c0aa1cd0 Merge remote-tracking branch 'github/master' into xtr/session-projection-migrations
# Conflicts:
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	packages/context/session-reference/package.json
#	packages/context/session-reference/tests/session-reference.spec.ts
#	packages/subagent/tool-subagent/src/index.ts
#	packages/subagent/tool-subagent/src/invariant.ts
#	packages/subagent/tool-subagent/src/model-selection-state.ts
#	packages/subagent/tool-subagent/tests/harness.ts
#	packages/subagent/tool-subagent/tests/list-models.spec.ts
#	packages/subagent/tool-subagent/tests/model-selection-settings.spec.ts
#	packages/subagent/tool-subagent/tests/tool-subagent.spec.ts
#	pnpm-lock.yaml
2026-08-27 16:38:06 +08:00
_Kerman
1c2acd9157 refactor(permission): project the seed boundary 2026-08-27 16:25:43 +08:00
imccyu
008ae0c01e docs(inspector): record cross-realm architecture 2026-08-27 16:16:24 +08:00
lsdsjy
af562d3649 fix(api-gateway): keep idle websocket alive 2026-08-27 14:48:13 +08:00
_Kerman
eeb4ca2b87 Merge remote-tracking branch 'origin/master' into xtr/session-projection-migrations 2026-08-27 12:03:10 +08:00
Dudu-0223
7c626fb5d2 fix(subagent): gate model selection with explicit allowlist 2026-08-27 12:00:02 +08:00
Dudu-0223
aefc083be7 feat(subagent): authorize selectable child models 2026-08-27 12:00:01 +08:00
pku-xht
86fa9f512b Merge origin/master into schedule-web-catalog 2026-08-27 05:26:09 +08:00
pku-xht
a5330ecf99 Merge commit 'e25ae41263f1ce4066aa8352f76d3d6d077b7959' into schedule-web-catalog
# Conflicts:
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/client/ui-workspace/package.json
2026-08-27 03:13:03 +08:00
imccyu
0a9a9ee686 docs(api): record settings Remote migration 2026-08-27 03:00:25 +08:00
imccyu
54d77eff00 docs(directory-picker): record the Remote transport 2026-08-27 02:20:40 +08:00
pku-xht
9e17966e05 Merge commit '9acb9c5ac5de67a511afedbb30e74edbdbc4d57e' into schedule-web-catalog
# Conflicts:
#	apps/web/tests/schedule-after.e2e.ts
#	docs/module-graph.i18n.yaml
#	docs/module-graph.md
#	docs/module-graph.zh.md
#	packages/api/session-controller/tests/manager.client.spec.ts
#	packages/extensions/cordis-client-runner/src/client/slot-catalog.ts
2026-08-26 21:27:19 +08:00
_Kerman
bd6f72cbbb Merge remote-tracking branch 'origin/master' into xtr/session-projection-migrations 2026-08-26 19:59:02 +08:00
_Kerman
96c1c762d5 fix(session-projection): preserve optional registrations 2026-08-26 16:51:36 +08:00
Magolor
df76bc695b feat(session): reduce persistence storage size (#3048) 2026-08-26 08:01:07 +00:00
_Kerman
81e07e3935 Merge remote-tracking branch 'origin/master' into xtr/session-projection-migrations 2026-08-26 15:15:04 +08:00
_Kerman
e296e79b18 fix(session-projection): complete mandatory compositions 2026-08-26 15:13:51 +08:00
imccyu
64575de655 docs(subagent): regenerate Remote references 2026-08-26 14:52:53 +08:00
_Kerman
212df86cf8 refactor(session): migrate simple folds to projections 2026-08-26 13:23:01 +08:00
imccyu
5752b1dc3c docs(agent-presets): refresh @Remote migration references 2026-08-26 11:18:36 +08:00
fengsy
eadd5df82b fix(team): preserve current Client architecture after rebase 2026-08-26 10:56:57 +08:00
pku-xht
673aeb65af Merge commit 'a75a281deadcd90a3841bdd2efebbbbfd68696fc' into schedule-web-catalog
# Conflicts:
#	docs/config-catalog.i18n.yaml
#	docs/config-catalog.md
#	docs/config-catalog.zh.md
#	docs/subsystems/session-projection.i18n.yaml
#	docs/subsystems/session-projection.md
#	docs/subsystems/session-projection.zh.md
#	packages/client/README.i18n.yaml
#	packages/client/README.md
#	packages/client/README.zh.md
#	packages/extensions/tool-cordis/src/api-catalog.ts
#	packages/schedule/README.i18n.yaml
#	packages/schedule/README.md
#	packages/schedule/README.zh.md
#	packages/schedule/schedule/README.i18n.yaml
#	packages/schedule/schedule/README.md
#	packages/schedule/schedule/README.zh.md
#	packages/session/session-projection-cache/README.i18n.yaml
#	packages/session/session-projection-cache/README.md
#	packages/session/session-projection-cache/README.zh.md
#	packages/session/session-projection-cache/src/index.ts
#	packages/session/session-projection-cache/src/spec.ts
#	packages/session/session-projection-cache/tests/cache.spec.ts
#	packages/session/session-projection/README.i18n.yaml
#	packages/session/session-projection/README.md
#	packages/session/session-projection/README.zh.md
2026-08-26 00:51:57 +08:00
fengsy
1477d5b9ef fix(profile): preserve current fallback architecture after rebase 2026-08-26 00:15:18 +08:00
Dudu-0223
a6c274e250 feat(team): add experimental Agent Teams CLI profile 2026-08-26 00:13:35 +08:00
Magolor
0b5eba0c8d docs: rebuild the documentation skill and standards (#2983) 2026-08-25 23:47:20 +08:00
pku-xht
5fe7dc333f fix(session): reconcile cached projection hints 2026-08-25 22:17:55 +08:00