Commit Graph

35997 Commits

Author SHA1 Message Date
Josh Lehman 0cdb050bac test: import model-run prune helper 2026-06-24 13:42:39 -07:00
Josh Lehman fab0048d7b fix: preserve plugin maintenance config compatibility 2026-06-24 13:42:39 -07:00
Josh Lehman 4a7659920c chore: drop unrelated formatting churn 2026-06-24 13:42:39 -07:00
Josh Lehman 070996e5c3 fix: keep model-run pruning internal 2026-06-24 13:42:39 -07:00
wanglu241 af8cd23f17 fix(sessions): keep plugin SDK maintenanceConfig backward-compatible
The model-run maintenance fields (modelRunPruneAfterMs from #88632 base work,
modelRunPruneAfterConfigured from the pressure-gating fix) were required on the
resolved maintenance config exposed to plugins via patchSessionEntry's
maintenanceConfig. External plugin TypeScript callers that construct a
pre-#88632 maintenanceConfig would fail to compile.

Make both fields optional on ResolvedSessionMaintenanceConfig (and the runtime
type), so old-shape plugin configs keep compiling. All internal readers already
treat an absent value as unset: shouldRunModelRunPrune returns false when
modelRunPruneAfterMs == null and modelRunPruneAfterConfigured is falsy, so a
plugin-supplied config without the fields runs no model-run pruning — the
pre-#88632 behavior. The resolver still always populates both fields, so normal
runtime behavior is unchanged. Add an old-shape maintenanceConfig SDK
regression test.
2026-06-24 13:42:39 -07:00
wanglu241 2fe50f69db fix(sessions): align forced model-run prune with cap eviction
Forced maintenance (sessions cleanup / maintenanceOverride) caps immediately to
maxEntries, but the unset model-run default was high-water gated. In the
(maxEntries, high-water) window stale model-run probes survived while the forced
cap evicted real sessions — the inverse of #88632. shouldRunModelRunPrune now
takes a force flag: when the caller caps immediately, the unset default prunes
once entryCount > maxEntries. Wire force at the two forced call sites
(applyEnforcedMaintenance, previewStoreCleanup). Make the SDK runtime config
field modelRunPruneAfterConfigured optional (additive). Add force-gate unit
test + forced-apply regression test.
2026-06-24 13:42:39 -07:00
wanglu241 fc198d862a Gate default model-run session pruning 2026-06-24 13:42:39 -07:00
wanglu241 2ddedad1d0 fix(sessions): tighten gateway model-run key predicate
The model-run prune predicate fell back to testing the raw sessionKey
when parseAgentSessionKey returned null, so unscoped keys like
`explicit:model-run-<uuid>` and shapes with empty agent ids were
eligible for the new default 24h cleanup. Restrict matching to keys
that successfully parse as agent-scoped with a non-empty agent id,
and add negative tests covering unscoped, empty-agent, extra-segment,
and whitespace-padded keys.

Refs #88632 (review feedback before merge).
2026-06-24 13:42:39 -07:00
wanglu241 33d0019eaf fix(config): validate model-run session retention 2026-06-24 13:42:39 -07:00
wanglu241 875e26e4bb fix(sessions): prune stale gateway model-run sessions 2026-06-24 13:42:39 -07:00
Shakker 6d0306b920 test: centralize status env fixture 2026-06-24 20:48:54 +01:00
Shakker e2d282f16e fix: route gateway option env mutations 2026-06-24 20:44:01 +01:00
Shakker 365279b86f fix: route temp home env setup 2026-06-24 20:32:41 +01:00
Shakker 1adc076148 test: trim rescue channel fixture imports 2026-06-24 20:28:42 +01:00
Shakker a49816ffbb fix: route rescue channel env lifecycle 2026-06-24 20:27:53 +01:00
Shakker fa6a9509bc test: isolate crestodian state env 2026-06-24 20:25:05 +01:00
Shakker 9d82906f79 fix: route transcript fixture state env 2026-06-24 20:23:09 +01:00
Agustin Rivera 3168987b28 fix(exec): gate versioned inline interpreters (#96216)
* fix(exec): gate versioned inline interpreters

* fix(exec): trim unsupported R inline flag

* fix(exec): avoid r2 inline eval collision
2026-06-24 12:22:49 -07:00
Josh Lehman 7e2b2d2987 refactor: migrate bundled session metadata reads (#96527) 2026-06-24 12:19:53 -07:00
Shakker c561319708 test: centralize plugin temp home env 2026-06-24 20:14:51 +01:00
Shakker 00b6f49b24 test: harden env helper lifecycle coverage 2026-06-24 20:05:47 +01:00
Shakker eac1d3349c test: narrow profile state directory type 2026-06-24 19:57:39 +01:00
Shakker aa56abc94a fix: share profile gateway env restoration 2026-06-24 19:57:39 +01:00
Josh Lehman b6bc3ed0db fix: Codex turns stop showing typing during tool work (#95844)
* fix: bridge harness execution phases to typing

* docs: clarify typing indicator activity triggers
2026-06-24 11:50:09 -07:00
Shakker 9ad959a870 test: route trajectory export env setup 2026-06-24 19:44:48 +01:00
Shakker f2bc159b79 fix: route Codex harness fixture env setup 2026-06-24 19:42:47 +01:00
Shakker 8ecbf83c67 test: route CLI backend fixture env setup 2026-06-24 19:32:12 +01:00
Shakker 3fbdbb5440 fix: route ACP spawn fixture env setup 2026-06-24 19:29:48 +01:00
Shakker ff332d3819 test: share Codex bind env lifecycle 2026-06-24 19:23:55 +01:00
Shakker c2d2f7fef9 fix: route ACP bind state env setup 2026-06-24 19:20:07 +01:00
Josh Lehman 4d4769c0d6 refactor(path3): narrow bundled session runtime barrels (#96507) 2026-06-24 10:33:40 -07:00
Agustin Rivera bcbd521c1b fix(gateway): cap auth limiter entries (#96224) 2026-06-24 10:22:57 -07:00
Drew Meyer 94ab33036e fix(discord): avoid duplicate typing keepalive for tool replies (#84288)
Co-authored-by: Andrew Meyer <andrewmeyer@andrews-air.lan>
2026-06-25 01:22:18 +08:00
Gio Della-Libera c5f10b5f7c Doctor: expose config audit scrub findings (#84450)
* feat(doctor): expose config audit scrub findings

* fix(doctor): keep audit scrub lint opt-in

* fix(doctor): keep audit lint defaults internal

* fix(doctor): remove duplicate lint default guard
2026-06-24 09:34:28 -07:00
Dallin Romney f29dbd3ebd test(qa): speed up smoke profile (#96340) 2026-06-24 09:30:59 -07:00
ly-wang19 db3307b02a fix(canvas): stop self-closing embed from starting a greedy block match (#96449)
Merged via squash.

Prepared head SHA: 7253bb298e
Co-authored-by: ly-wang19 <94427531+ly-wang19@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-06-24 23:46:20 +08:00
Galin Iliev ce6d97d580 fix(plugins): suppress metadata cache hit scan spans (#86796)
Merged via squash.

Prepared head SHA: a4907bf285
Co-authored-by: galiniliev <5711535+galiniliev@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-06-24 23:09:12 +08:00
Vincent Koc eabc12b7d6 fix(sandbox): install supported node in common image 2026-06-24 22:54:00 +08:00
Josh Lehman b58e6e0734 refactor: route session status through session accessors (#96460) 2026-06-24 07:44:19 -07:00
狼哥 374076b5a8 fix(plugins): retain plugin tool registry after replacement (#82562)
Merged via squash.

Prepared head SHA: 1bcbbbfbc1
Co-authored-by: luoyanglang <238804951+luoyanglang@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-06-24 22:22:29 +08:00
Ayaan Zaidi 3179692f0e fix(messages): apply response usage to followups 2026-06-24 07:12:33 -07:00
Peter Lindsey 6add1cc969 feat(messages): config-level default for the persistent /usage footer
Adds `messages.responseUsage` (precedence session -> channel -> config default
-> off) so the persistent /usage footer can default-on, with three distinct
states: explicit on (tokens/full), explicit off (persisted), and unset (inherit
the configured default).

Unifies effective-value resolution behind a single channel-aware resolver
`resolveEffectiveResponseUsage` used by reply rendering, the no-arg /usage
toggle, the ACP control, and the gateway session-row builder; the row builder's
`effectiveResponseUsage` is carried through sessions.changed events, chat
snapshots, and the UI row so live consumers never go stale. `/usage reset`
(aliases inherit/clear/default) clears the override to inherit; only explicit
off persists; a full session reset preserves the preference. ACP "Usage detail"
gains an "inherit" option for unset sessions. Docs/help/completions updated; "on"
documented as a legacy alias; config-doc baseline regenerated.
2026-06-24 07:12:33 -07:00
ly-wang19 cb13be375d fix(tasks): preserve both cron-run session key shapes during maintenance (#96352)
* fix(tasks): preserve both cron-run session key shapes during maintenance

Session-registry maintenance keeps running cron jobs' session rows, but
readRunningCronJobIds built the preserve-set with job.id.toLowerCase() only.
Cron-run session keys carry two job-segment shapes: main-session runs use the
slugified segment (normalizeCronLaneSegment, e.g. "daily-report") while
default-isolated runs use the raw lowercased id ("daily report", built from
cron:${job.id} via toAgentStoreSessionKey, which lowercases but does not
slugify). The lowercase-only matcher preserved isolated runs but pruned
main-session runs of any non-slug job id (e.g. "Daily Report") as stale.

Preserve both shapes (raw lowercased id and slugified segment). This is
strictly more-preserving, so no live running cron session is dropped. Adds a
regression test seeding both a slug main-session run and a raw isolated run for
a non-slug job id, asserting both survive while a non-running job's run is still
pruned.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(tasks): match cron session keys to target shape

* fix(tasks): preserve active cron aliases across retargeting

* fix(tasks): retain explicit cron session aliases

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-06-24 22:10:49 +08:00
Josh Lehman acc2a0ee72 refactor: route boot session mapping through accessor (#96225) 2026-06-24 06:54:19 -07:00
Gio Della-Libera 704fc35043 Doctor: expose session lock findings (#84366)
Merged via squash.

Prepared head SHA: 93192bb7ab
Co-authored-by: giodl73-repo <235387111+giodl73-repo@users.noreply.github.com>
Co-authored-by: giodl73-repo <235387111+giodl73-repo@users.noreply.github.com>
Reviewed-by: @giodl73-repo
2026-06-24 06:53:01 -07:00
Ayaan Zaidi f1e38f2ed6 fix(telegram): narrow rich table alignment surface 2026-06-24 06:41:38 -07:00
张贵萍0668001030 77eb0fdbaa fix(telegram): preserve rich table styling 2026-06-24 06:41:38 -07:00
snowzlmbot f3891e1335 fix(context-engine): avoid quarantining read-only discovery factories (#96357)
* fix(context-engine): ignore read-only discovery factories

* fix(context-engine): keep discovery registrations out of runtime probes

---------

Co-authored-by: snowzlmbot <snowzlmbot@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-06-24 21:33:49 +08:00
Ayaan Zaidi 17066f2d7c fix(cron): preserve default toolsAllow markers safely 2026-06-24 06:26:52 -07:00
Cameron Beeley 9aea104cc8 fix(cron): stop stamping an unenforceable default toolsAllow cap on CLI runs
#91499 auto-stamps the creator's tool surface as a default toolsAllow cap
on agentTurn cron payloads whenever the creating session is tool-restricted
(a narrowing allow-policy or an explicit deny). CLI backends cannot enforce
a runtime toolsAllow — cli-runner/prepare.ts rejects any defined allow-list
— so every scheduled agentTurn that resolves to a CLI backend (e.g.
claude-cli) fails to start. This silently broke per-thread scheduled
continuations on CLI backends.

A CLI backend is not a runtime tool-policy boundary: it runs with its own
configured tool set, as the operator, on the local machine, and refuses a
runtime allow-list outright. An inherited default cap is therefore
unenforceable on a CLI backend. Decide at run time, where the backend is
known:

- Flag the default. capCronAgentTurnToolsAllow stamps toolsAllowIsDefault
  when it fills in the creator surface because the cron requested nothing
  (or a bare "*"). An explicit narrowing or empty allow-list is a real
  per-cron restriction and carries no flag.
- Drop only the default, only on CLI. The run-executor drops a flagged
  default in the CLI branch and lets the run proceed. An explicit per-cron
  restriction (no flag) is deliberately passed through, so prepare.ts still
  fails it closed and surfaces that the requested policy needs an embedded
  runtime. Embedded runs are untouched and keep the full cap enforced.
- Persist the flag. New nullable cron_jobs.payload_tools_allow_is_default
  column (additive ensureColumn migration + codec read/write) so the
  decision survives a gateway restart, plus toolsAllowIsDefault on the
  gateway-protocol agentTurn payload schema — the stamped payload is
  otherwise rejected by the contract's additionalProperties:false.
- Preserve the flag across updates. A no-toolsAllow update (reschedule,
  prompt edit) no longer carries the stored default forward as a literal
  value — that routed it through the explicit-narrowing branch, stripped the
  flag, and re-broke the job on CLI after the next restart. The default is
  re-derived (flag intact); an explicit restriction is still carried forward
  unflagged.

Net policy: on CLI only the unenforceable inherited default is relaxed;
explicit per-cron restrictions still fail closed; embedded backends are
unchanged.

Tests: run-executor drops the flagged default but propagates an explicit
restriction on CLI; cron-tool stamps/clears the flag across create and
update and preserves it across a no-toolsAllow update; store round-trips the
flag (and its absence) through SQLite.

Not covered: agentTurn crons created during the regression window carry a
flagless toolsAllow and remain fail-closed on CLI until recreated or updated
with an explicit toolsAllow.
2026-06-24 06:26:52 -07:00