Commit Graph

5612 Commits

Author SHA1 Message Date
Vincent Koc
a16331c36e fix(ci): align cron and session tests with runtime 2026-04-13 22:37:25 +01:00
Bob
8c7f17b953 fix: count unknown-tool retries only when streamed (#66145)
Merged via squash.

Prepared head SHA: b79209cdb5
Co-authored-by: Bob <dutifulbob@gmail.com>
Reviewed-by: @osolmaz
2026-04-13 22:49:05 +02:00
Vincent Koc
ce1fffa97e perf(agents): narrow session helper imports 2026-04-13 21:09:44 +01:00
Vincent Koc
99755fcb2f perf(agents): lazy-load session store updates 2026-04-13 21:07:50 +01:00
Vincent Koc
dd27aa945e perf(agents): lazy-load delivery runtime 2026-04-13 21:05:30 +01:00
Vincent Koc
f126088761 perf(agents): keep attempt execution runtime cold 2026-04-13 21:03:52 +01:00
Vincent Koc
ac00ba1943 perf(commands): lazy-load agent secret resolution 2026-04-13 20:56:03 +01:00
Vincent Koc
f2e08295e6 perf(commands): narrow agent config imports 2026-04-13 20:51:35 +01:00
Vincent Koc
9a2675e9fd perf(agents): lazy-load cli runner seams 2026-04-13 20:43:58 +01:00
Tak Hoffman
7c09ba70ef fix(trace command): Improve trace raw diagnostics and trace command UX (#66089)
* improve trace raw diagnostics and command acks

* address trace review feedback

* avoid sync transcript reads in raw trace

* preserve raw cli output for trace

* gate trace emission at reply time

* reflect raw trace mode in status surfaces
2026-04-13 14:26:57 -05:00
屈定
95ee120a91 fix: classify openrouter json 404 model errors
Rewrites the stale branch on top of current `main` and preserves the original issue as regression coverage for the exact OpenRouter JSON 404 payload from #51571.

No production behavior changes are introduced here; current `main` already classifies this payload as `model_not_found`, and this merge locks that in across the shared matcher, failover classifier, and fallback loop.

Co-authored-by: 屈定 <mrdear@users.noreply.github.com>
Co-authored-by: Altay <altay@uinaf.dev>
2026-04-13 19:53:55 +01:00
pashpashpash
8efbe8c1ed agents: stop strict mode from hijacking chat turns 2026-04-13 11:49:00 -07:00
Vincent Koc
a372e4a152 perf(agents): isolate agent scope config helpers 2026-04-13 18:49:25 +01:00
Vincent Koc
117ae85bf5 perf(agents): isolate thinking default helper 2026-04-13 18:39:38 +01:00
Vincent Koc
93ce76afe3 perf(agents): use lightweight model fallback selection helpers 2026-04-13 18:12:09 +01:00
Vincent Koc
241349cdc5 perf(cron): use lightweight model selection resolver 2026-04-13 18:12:09 +01:00
Vincent Koc
bde246e7af perf(auth-profiles): narrow source check path imports 2026-04-13 17:23:59 +01:00
Vincent Koc
da3977e681 perf(agents): narrow failover helper imports 2026-04-13 17:21:21 +01:00
Vincent Koc
95517edaeb perf(agents): keep model fallback auth runtime cold 2026-04-13 16:50:30 +01:00
Bob
74f2c4a56b fix: stop repeated unknown-tool loops (#65922)
Merged via squash.

Prepared head SHA: f352a270a6
Reviewed-by: @osolmaz
2026-04-13 17:42:11 +02:00
Vincent Koc
2bc031c357 perf(cron): keep auth profile runtime cold 2026-04-13 16:30:28 +01:00
Vincent Koc
bfc77b0f45 perf(agents): keep fallback auth store cold without sources 2026-04-13 15:58:35 +01:00
Tak Hoffman
dc5ed7edea fix(logging) add failover log source and target (#65955)
* clarify failover log source and target

* fix embedded runner final assistant raw text helper
2026-04-13 08:56:10 -05:00
EVA
c15b295a85 Run context-engine turn maintenance as idle-aware background work (#65233)
Merged via squash.

Prepared head SHA: e9f6c679ba
Co-authored-by: 100yenadmin <239388517+100yenadmin@users.noreply.github.com>
Co-authored-by: jalehman <550978+jalehman@users.noreply.github.com>
Reviewed-by: @jalehman
2026-04-13 06:50:22 -07:00
Bob
380de88a61 fix: extract shared session status runtime (#65807)
Merged via squash.

Prepared head SHA: f027bd640a
Co-authored-by: dutifulbob <261991368+dutifulbob@users.noreply.github.com>
Co-authored-by: osolmaz <2453968+osolmaz@users.noreply.github.com>
Reviewed-by: @osolmaz
2026-04-13 11:51:26 +02:00
Rugved Somwanshi
0cfb83edfa feat: LM Studio Integration (#53248)
* Feat: LM Studio Integration

* Format

* Support usage in streaming true

Fix token count

* Add custom window check

* Drop max tokens fallback

* tweak docs

Update generated

* Avoid error if stale header does not resolve

* Fix test

* Fix test

* Fix rebase issues

Trim code

* Fix tests

Drop keyless

Fixes

* Fix linter issues in tests

* Update generated artifacts

* Do not have fatal header resoltuion for discovery

* Do the same for API key as well

* fix: honor lmstudio preload runtime auth

* fix: clear stale lmstudio header auth

* fix: lazy-load lmstudio runtime facade

* fix: preserve lmstudio shared synthetic auth

* fix: clear stale lmstudio header auth in discovery

* fix: prefer lmstudio header auth for discovery

* fix: honor lmstudio header auth in warmup paths

* fix: clear stale lmstudio profile auth

* fix: ignore lmstudio env auth on header migration

* fix: use local lmstudio setup seam

* fix: resolve lmstudio rebase fallout

---------

Co-authored-by: Frank Yang <frank.ekn@gmail.com>
2026-04-13 15:22:44 +08:00
pashpashpash
c848ebc8ce agents: split GPT-5 prompt and retry behavior (#65597)
* agents: split GPT-5 prompt and retry behavior

* agents: fix GPT-5 review follow-ups

* agents: address GPT-5 review follow-ups

* agents: avoid replaying side-effectful GPT retries

* agents: mark subagent control as mutating

* agents: fail closed on single-action retries

* commands: stabilize channel legacy doctor migration test

* agents: narrow single-action retry promise trigger
2026-04-12 18:52:22 -07:00
joshavant
c4764095f8 Outbound: centralize payload normalization plan 2026-04-12 19:52:24 -05:00
Peter Steinberger
03d042d2b9 perf: mock hot agents import tests 2026-04-13 01:35:52 +01:00
Peter Steinberger
5b2ae49107 perf: reduce agents test import overhead 2026-04-13 01:26:44 +01:00
Vincent Koc
4c8337f27b test(agents): stabilize steer restart ordering 2026-04-13 01:25:45 +01:00
EVA
26945ddb49 agents: GPT-5.4 runtime completion rollup (#65219)
* agents: auto-activate strict-agentic for GPT-5 and emit blocked-exit liveness

Closes two hard blockers on the GPT-5.4 parity completion gate:

1) Criterion 1 (no stalls after planning) is universal, but the pre-existing
   strict-agentic execution contract was opt-in only. Out-of-the-box GPT-5
   openai / openai-codex users who never set
   `agents.defaults.embeddedPi.executionContract` still got only 1
   planning-only retry and then fell through to the normal completion path
   with the plan-only text, i.e. they still stalled.

   Introduce `resolveEffectiveExecutionContract(...)` in
   src/agents/execution-contract.ts. Behavior:

   - supported provider/model (openai or openai-codex + gpt-5-family) AND
     explicit "strict-agentic" or unspecified → "strict-agentic"
   - supported provider/model AND explicit "default" → "default" (opt-out)
   - unsupported provider/model → "default" regardless of explicit value

   `isStrictAgenticExecutionContractActive` now delegates to the effective
   resolver so the 2-retry + blocked-state treatment applies by default to
   every GPT-5 openai/codex run. Explicit opt-out still works for users who
   intentionally want the pre-parity-program behavior.

2) Criterion 4 (replay/liveness failures are explicit, not silent
   disappearance) is violated by the strict-agentic blocked exit itself.
   Every other terminal return path in src/agents/pi-embedded-runner/run.ts
   sets `replayInvalid` + `livenessState` via `setTerminalLifecycleMeta`,
   but the strict-agentic exit at run.ts:1615 falls through without them.

   Add explicit `livenessState: "abandoned"` + `replayInvalid` (via the
   shared `resolveReplayInvalidForAttempt` helper) to that exit, plus a
   `setTerminalLifecycleMeta` call so downstream observers (lifecycle log,
   ACP bridge, telemetry) see the same explicit terminal state they see on
   every other exit branch.

Regressions added:

- `auto-enables update_plan for unconfigured GPT-5 openai runs`
- `respects explicit default contract opt-out on GPT-5 runs`
- `does not auto-enable update_plan for non-openai providers even when unconfigured`
- `emits explicit replayInvalid + abandoned liveness state at the strict-agentic blocked exit`
- `auto-activates strict-agentic for unconfigured GPT-5 openai runs and surfaces the blocked state`
- `respects explicit default contract opt-out on GPT-5 openai runs`

Local validation:

- pnpm test src/agents/openclaw-tools.update-plan.test.ts src/agents/pi-embedded-runner/run.incomplete-turn.test.ts src/agents/pi-embedded-runner.buildembeddedsandboxinfo.test.ts src/agents/system-prompt.test.ts src/agents/openclaw-tools.sessions.test.ts src/agents/pi-embedded-runner/run.overflow-compaction.test.ts

122/122 passing.

Refs #64227

* agents: address loop-6 review comments on strict-agentic contract

Triages all three loop-6 review comments on PR #64679:

1. Copilot: 'The strict-agentic blocked exit returns an error payload
   (isError: true) but sets livenessState to "abandoned". Elsewhere in
   the runner/lifecycle flow, error terminal states are treated as
   "blocked".' Verified: every other hardcoded error terminal branch in
   run.ts (role ordering at 1152, image size at 1206, schema error at
   1244, compaction timeout at 1128, aborted-with-no-payloads at 606)
   uses livenessState: "blocked". Match that convention at the
   strict-agentic blocked exit at 1634. Updated the 'emits explicit
   replayInvalid + abandoned liveness state' regression test to assert
   the new "blocked" value and renamed the assertion commentary.

2. Copilot: 'The JSDoc for resolveEffectiveExecutionContract says
   explicit "strict-agentic" in config always resolves to
   "strict-agentic", but the implementation collapses to "default"
   whenever the provider/mode is unsupported.' Rewrite the JSDoc to
   explicitly document the unsupported-provider collapse as the lead
   case (strict-agentic is a GPT-5-family openai/openai-codex-only
   runtime contract) before listing the supported-lane behavior matrix.
   No code change; this is a docstring-only clarification.

3. Greptile P2: 'Non-preferred Anthropic model constant. CLAUDE.md says
   to prefer sonnet-4.6 for Anthropic test constants.' Swap
   claude-opus-4-6 → claude-sonnet-4-6 in the two update_plan gating
   fixtures that assert non-openai providers don't auto-enable the
   planning tool. Behavior unchanged; model constant now matches repo
   testing guidance.

Local validation:

- pnpm test src/agents/openclaw-tools.update-plan.test.ts src/agents/pi-embedded-runner/run.incomplete-turn.test.ts

29/29 passing.

Refs #64227

* test: rename strict-agentic blocked-exit liveness regression to match blocked state

Addresses loop-7 Copilot finding on PR #64679: loop 6 changed the
assertion to livenessState === 'blocked' to match the rest of the
hard-error terminal branches in run.ts, but the test title still said
'abandoned liveness state', which made failures and test output
misleading. Rename the test title to match the asserted value. No
code change beyond the it(...) title.

Validation: pnpm test src/agents/pi-embedded-runner/run.incomplete-turn.test.ts
(19/19 pass).

Refs #64227

* agents: widen strict-agentic auto-activation to handle prefixed and variant GPT-5 model ids

* Align strict-agentic retry matching

* runtime: harden strict-agentic model matching

---------

Co-authored-by: Eva <eva@100yen.org>
2026-04-12 16:36:11 -07:00
pashpashpash
383c854313 CI: fix mainline regression blockers (#65269)
* MSTeams: align logger test expectations

* Gateway: fix CI follow-up regressions

* Config: refresh generated schema baseline

* VoiceCall: type webhook test doubles

* CI: retrigger blocker workflow

* CI: retrigger retry workflow

* Agents: fix current mainline agentic regressions

* Agents: type auth controller test mock

* CI: retrigger blocker validation

* Agents: repair OpenAI replay pairing order
2026-04-13 06:18:37 +09:00
Peter Steinberger
5d9a04d4c1 perf: lazy-load session store helpers 2026-04-12 20:17:42 +01:00
Peter Steinberger
19d8069aea fix: lazy-start gateway mcp loopback 2026-04-12 19:08:58 +01:00
Vincent Koc
fcae3bf943 fix(agents): preserve active-turn queued user prompts (#65478)
* fix(agents): preserve active-turn queued user prompts

* Update src/agents/pi-embedded-runner/run/attempt.prompt-helpers.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update CHANGELOG.md

* Update CHANGELOG.md

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-12 19:02:55 +01:00
Peter Steinberger
e24b80b15e fix: clarify escaped skill path warnings 2026-04-12 10:53:31 -07:00
Vincent Koc
f00f0a9596 fix(agents): stop leaking session lock exit listeners (#65469)
* fix(agents): stop leaking session lock exit listeners

* Update src/agents/session-write-lock.ts

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

---------

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
2026-04-12 18:22:12 +01:00
Nimrod Gutman
26dbc3da15 fix(agents): isolate skills tests from personal home (#65456) 2026-04-12 19:44:50 +03:00
Peter Steinberger
50fcdb36a8 fix: preserve prompt budget for small context models 2026-04-12 17:16:37 +01:00
Vincent Koc
d46f684898 test(agents): fix tsgo typing regressions 2026-04-12 17:02:24 +01:00
Peter Steinberger
c146738996 fix: stabilize subagent cleanup retries 2026-04-12 16:59:27 +01:00
Vincent Koc
156ee544ed test(agents): share notify heartbeat wake helper 2026-04-12 16:43:39 +01:00
Vincent Koc
559de69488 test(agents): share ollama auth fixture 2026-04-12 16:40:28 +01:00
Vincent Koc
4b761f6e23 test(agents): share gemini model fixture 2026-04-12 16:38:25 +01:00
Vincent Koc
d0f090e188 test(agents): share exec preflight race helper 2026-04-12 16:36:46 +01:00
Vincent Koc
93abf5ee4d test(agents): share websocket tool followup helper 2026-04-12 16:35:01 +01:00
Vincent Koc
4904e15349 test(agents): share anthropic vertex adc fixture 2026-04-12 16:32:26 +01:00
Vincent Koc
a19e492fb3 test(agents): trim subagent spawn config duplication 2026-04-12 16:30:31 +01:00
Vincent Koc
48f74a599e test(agents): share bundle mcp runtime fixture 2026-04-12 16:28:27 +01:00