Commit Graph

7235 Commits

Author SHA1 Message Date
Peter Steinberger
a0ea07e462 fix: recognize attachment message sends 2026-05-05 23:19:36 +01:00
Vincent Koc
a36981a2c5 test(agents): isolate auth profile store fixtures 2026-05-05 14:53:35 -07:00
Peter Steinberger
4ddbdff7c0 refactor: drop legacy agent path files 2026-05-05 20:07:49 +01:00
Peter Steinberger
35da7d2c99 refactor: remove legacy agent dir resolver 2026-05-05 20:07:49 +01:00
Peter Steinberger
64b1f5fbf4 test: speed up changed test paths 2026-05-05 19:48:19 +01:00
Peter Steinberger
7188e4f4ad refactor: centralize agent run pending status 2026-05-05 18:21:58 +01:00
Peter Steinberger
b32d4c5255 fix: avoid media completion fallback while announce pending 2026-05-05 18:11:30 +01:00
Neerav Makwana
63ce0ca966 fix: persist embedded session transcripts (#77839) (thanks @neeravmakwana)
* fix(agents): persist embedded runner session transcripts (#77823)

Run persistCliTurnTranscript and post-turn compaction for executionTrace.runner embedded,
matching CLI turns so assistant text reaches session JSONL for webchat/Feishu-style runs.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(agents): narrow embedded transcript mirror with assistant dedupe (#77823)

Embedded runs pass embeddedAssistantGapFill so persistCliTurnTranscript skips
re-appending the user prompt Pi owns and only appends assistant text when the
transcript tail lacks equivalent visible assistant content.

Adds CLI transcript regression coverage for gap-fill dedupe.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(agents): dedupe embedded transcript gap fill by tail

* fix: persist embedded session transcripts (#77839) (thanks @neeravmakwana)

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-05-05 21:35:08 +05:30
Ayaan Zaidi
5d03fb2553 fix: preserve final text after silent block chunks (#77840) (thanks @neeravmakwana) 2026-05-05 21:20:39 +05:30
Neerav Makwana
cb8c94a8cb fix(embed): set lastBlockReplyText only after emitting block reply
When directive consume() returned null (e.g. silent NO_REPLY chunk) or the
cleaned payload was empty, we still set lastBlockReplyText, so message_end
skipped the safety send while no channel delivery had occurred.

Fixes #77833.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-05 21:20:39 +05:30
Vincent Koc
7c13004883 test(live): skip synthetic auth in provider sweeps 2026-05-05 02:34:54 -07:00
Peter Steinberger
6f6b8fc465 fix(release): accept Docker OCI attestations and xAI reasoning defaults 2026-05-05 10:30:48 +01:00
Vincent Koc
c3a0fb9325 test(live): bound provider discovery hooks 2026-05-05 02:18:30 -07:00
Vincent Koc
9fa685e3b3 test(live): scope provider auth discovery 2026-05-05 02:03:42 -07:00
Vincent Koc
d862e90793 test(live): drop off-only Fireworks Kimi from high-signal sweep 2026-05-05 01:43:22 -07:00
Vincent Koc
9c4a335007 test(live): classify provider HTTP 5xx as server drift 2026-05-05 01:06:15 -07:00
Chunyue Wang
043cb32aab fix(session-file-repair): drop null-role message entries instead of preserving them (#77288)
type:"message" entries with a null, missing, or blank role cannot be
replayed to any provider — every router branches on message.role. The
auto-repair pass was passing them through unchanged, relocating the
corruption from the original file into the post-repair file (#77228
reported 935+ null-role entries surviving the pass).

Add isStructurallyInvalidMessageEntry ahead of the existing rewrite
predicates. Invalid message envelopes are counted as droppedLines and
skipped; non-message envelope types (summary, custom, …) are unaffected.
The .bak-* backup preserves the original bytes for postmortem before any
entries are dropped.

Tests:
- pnpm test src/agents/session-file-repair.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/session-file-repair.ts src/agents/session-file-repair.test.ts
- pnpm check:changed

Refs #77228
2026-05-05 14:46:42 +08:00
Chunyue Wang
24bd0b212f fix(replay-history): drop trailing stream-error placeholder before provider send (#77287)
normalizeAssistantReplayContent rewrites empty assistant error turns into
a STREAM_ERROR_FALLBACK_TEXT sentinel to satisfy Bedrock Converse's
non-empty ContentBlock requirement for non-trailing turns. When that
sentinel is the trailing entry, prefill-strict providers reject the
request with "400 This model does not support assistant message prefill.
The conversation must end with a user message." and the session cannot
recover on its own.

Add a post-loop tail trim that drops trailing assistant turns whose
content is empty with stopReason "error" or zero-usage empty stop, or
carries only the sentinel text with the same synthetic provenance. A real
model reply whose content happens to equal the sentinel string is
preserved by requiring zero usage or stopReason "error" before dropping.
The trim catches both the in-memory rewrite shape and the sentinel
persisted to disk by session-file-repair.

Tests:
- pnpm test src/agents/pi-embedded-runner/replay-history.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md src/agents/pi-embedded-runner/replay-history.ts
  src/agents/pi-embedded-runner/replay-history.test.ts
- pnpm check:changed

Refs #77228
2026-05-05 14:14:01 +08:00
clawsweeper[bot]
cd66854b66 feat(cron): add agentId filtering to cron list (#77602)
Summary:
- This PR adds optional `agentId` filtering to `cron.list`, auto-fills it for agent tool calls, exposes `openclaw cron list --agent`, updates generated protocol clients, docs, changelog, tests, and prompt fixtures.
- Reproducibility: yes. The motivating behavior is source-reproducible on current main because cron tool, CLI, ... e list paths do not accept or apply `agentId`; the PR diff adds that path with focused regression coverage.

Automerge notes:
- Ran the ClawSweeper repair loop before final review.
- Included post-review commit in the final squash: chore: regenerate protocol schema after adding agentId to CronListParams
- Included post-review commit in the final squash: feat(cron): add agentId filtering to cron list

Validation:
- ClawSweeper review passed for head 35b692bc97.
- Required merge gates passed before the squash merge.

Prepared head SHA: 35b692bc97
Review: https://github.com/openclaw/openclaw/pull/77602#issuecomment-4375631700

Co-authored-by: zhanggttry <zhanggttry@163.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-05 06:06:24 +00:00
Chunyue Wang
31da1fe5b0 fix(auth-profiles): exclude format rejections from profile cooldown (#77280)
Merged via squash.

Prepared head SHA: f4188b4dc3
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Co-authored-by: openperf <80630709+openperf@users.noreply.github.com>
Reviewed-by: @openperf
2026-05-05 13:35:41 +08:00
Vincent Koc
177167c846 fix(video): recover generation parameter fallbacks 2026-05-04 22:26:58 -07:00
Peter Steinberger
6c8974f3f5 fix: harden async media completion delivery 2026-05-05 06:13:33 +01:00
Sally O'Malley
349ce0056d fix: rebuild sandbox skill prompts from sandbox workspace (#77661)
Signed-off-by: sallyom <somalley@redhat.com>
2026-05-05 01:13:21 -04:00
Vincent Koc
557c5bf705 test(live): soften OpenAI cache telemetry floor 2026-05-04 22:01:08 -07:00
6607changchun
d02fbc6116 fix(sandbox): support Windows drive-letter bind sources
Accept drive-absolute Windows sandbox Docker bind sources in config and runtime validation while keeping blocked-path and allowed-root comparisons case-insensitive for Windows drive paths.

Also remove a stale WhatsApp setup import that blocked extension lint after the rebase.

Co-authored-by: 6607changchun <84566142+6607changchun@users.noreply.github.com>
Co-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-04 23:39:56 -05:00
兰之
c739088d62 fix(agents): enforce exact skill path from <available_skills> [AI-assisted] (#74161)
Summary:
- The PR updates agents skill prompt guidance to require exact `<location>` paths for single- and multi-skill selection, adds prompt assertions, and records the fix in the changelog.
- Reproducibility: yes. Static source reproduction is enough: current main lacks the exact-`<location>` guard  ... illsSection()`, while the PR diff adds it to both selection branches and asserts the resulting prompt text.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix: enforce exact skill paths for all skill matches

Validation:
- ClawSweeper review passed for head 743c9840c1.
- Required merge gates passed before the squash merge.

Prepared head SHA: 743c9840c1
Review: https://github.com/openclaw/openclaw/pull/74161#issuecomment-4341488109

Co-authored-by: tianguicheng <tianguicheng@xiaomi.com>
Co-authored-by: sallyom <somalley@redhat.com>
2026-05-05 02:51:31 +00:00
Bek
58c4f9e190 fix: slack keep resumed sends in thread (#77620)
carry agent thread context into the message tool so resumed Slack parent sends inherit the ambient thread when no explicit threadId is provided
2026-05-04 22:39:46 -04:00
Vincent Koc
30bb88d80e test(live): prefer stable OpenAI cache model 2026-05-04 18:40:23 -07:00
Peter Steinberger
25b30c9520 fix: honor embedded runtime tool allowlists (#77609)
* fix: honor embedded runtime tool allowlists

* fix: preserve plugin allowlist filtering

* fix: gate bundled lsp allowlists
2026-05-05 02:29:36 +01:00
Peter Steinberger
7168896fdf fix(agents): abort post-compaction loops out-of-band 2026-05-05 02:15:42 +01:00
Peter Steinberger
5dfaed1846 refactor(agents): use loop detection switch for post-compaction guard 2026-05-05 02:15:42 +01:00
Peter Steinberger
ed4b223cf2 fix(agents): honor scoped post-compaction guard config 2026-05-05 02:15:42 +01:00
Peter Steinberger
1af6855bb0 refactor(agents): thread post-compaction guard observer 2026-05-05 02:15:42 +01:00
Peter Steinberger
e0fafdcc1d fix(agents): observe post-compaction guard live 2026-05-05 02:15:42 +01:00
Peter Steinberger
0d3b74e45a test(agents): avoid redundant guard scope spread 2026-05-05 02:15:42 +01:00
Peter Steinberger
3ba0f588ad fix(agents): observe matched post-compaction tool outcomes 2026-05-05 02:15:42 +01:00
Eduardo Piva
4c4825679b fix(agents): make post-compaction guard config valid + observation trim-resilient
Two correctness fixes from code review.

1. Zod schema (src/config/zod-schema.agent-runtime.ts) was strict and
   rejected tools.loopDetection.postCompactionGuard.* keys at validation
   time, making the guard's documented configurability inaccessible at
   gateway startup. Adds ToolLoopPostCompactionGuardSchema with both
   optional fields and wires it into ToolLoopDetectionSchema.

2. The runner observation cursor in pi-embedded-runner/run.ts used
   absolute indices into state.toolCallHistory, but that array is
   trimmed at historySize (default 30). Once the buffer was full, new
   records shifted out from under the cursor and the guard silently
   missed every loop in long-running sessions. Replaces the index
   cursor with a monotonic toolOutcomeSeq on SessionState that
   recordToolCallOutcome bumps on each observable push (unmatched
   branch only, mirroring the prior cursor's effective semantics).
   The runner now reads the most recent (currentSeq - lastSeq) entries
   from the tail of toolCallHistory, which is trim-resilient.

Adds zod parse tests for the new config keys (valid, empty, unknown
key, non-positive, non-integer) and a runner regression test that
seeds toolCallHistory at the trim cap before triggering a
post-compaction loop, asserting the abort still fires.

Refs #77474
2026-05-05 02:15:42 +01:00
Eduardo Piva
2a702f927f feat(agents): wire post-compaction loop guard into pi-embedded-runner
Arms the guard at each of the three compaction-success points in
run.ts and observes tool-call outcomes from the diagnostic session
state's toolCallHistory after each attempt. Aborts with
PostCompactionLoopPersistedError when the same (tool, args, result)
triple repeats windowSize times within the post-compaction window.

Refs #77474
2026-05-05 02:15:42 +01:00
Eduardo Piva
5b863c719e fix(agents): address review feedback on post-compaction loop guard
- Add PostCompactionLoopPersistedError.fromVerdict factory.
- Add unit tests for the error class + fromVerdict adapter.
- Disabled guard is now truly dormant (no state mutation when enabled=false).
- Tighten help text for postCompactionGuard.enabled.

Refs #77474
2026-05-05 02:15:42 +01:00
Eduardo Piva
96e7461c81 feat(agents): add post-compaction loop guard module + config
Pure module with unit tests; not yet wired into runner. The guard arms
after auto-compaction-retry and aborts when the same (tool, args, result)
triple repeats within the configured window.

Refs #77474
2026-05-05 02:15:42 +01:00
Vincent Koc
7295f19fbc test(live): use low reasoning for cache probes 2026-05-04 18:13:05 -07:00
Elliot Drel
3e4f076723 fix(lsp): resolve Windows .cmd shims (#75343)
Resolve Windows npm .cmd shim startup failures for bundled LSP servers by routing LSP process spawning through the shared Windows spawn resolver with a sanitized child environment.

The change reuses existing PATH/PATHEXT and .cmd shim handling, keeps non-Windows behavior unchanged, and adds focused regression coverage for resolver wiring, env sanitization, and spawn materialization.

Fixes #75352.

Tests:
- pnpm test src/agents/pi-bundle-lsp-runtime.windows-spawn.test.ts src/agents/pi-bundle-lsp-runtime.test.ts
- pnpm check:changed

Thanks @ElliotDrel.

Co-authored-by: Elliot Drel <156480527+ElliotDrel@users.noreply.github.com>
Co-authored-by: Brad Groux <3053586+BradGroux@users.noreply.github.com>
2026-05-04 20:08:00 -05:00
Vincent Koc
b378a91257 test(live): retry cache probe text misses 2026-05-04 17:44:37 -07:00
Peter Steinberger
2d8fa23447 fix(agents): mediate async media completions 2026-05-05 01:42:50 +01:00
Peter Steinberger
48ff390953 perf(plugins): reuse compatible metadata snapshots
Reuse compatible workspace-scoped plugin metadata snapshots for unscoped model catalog and manifest-contract readers while preserving env/config/workspace compatibility checks.

Also updates the stale kitchen-sink prerelease canary assertion to the current script default.

Fixes #77519.
Related #77532.
2026-05-05 01:39:34 +01:00
Vincent Koc
306a582294 test(agents): remove redundant payload casts 2026-05-04 16:56:05 -07:00
Vincent Koc
d253392ea2 fix(plugins): keep explicit web providers on fast path 2026-05-04 16:56:05 -07:00
Josh Lehman
6dae3c273d fix: keep runtime prompt context out of system prompt (#77521) 2026-05-05 00:54:16 +01:00
Peter Steinberger
15d3fd83bb fix(openai-codex): match codex replay identity 2026-05-05 00:33:23 +01:00
mkdev11
27e467ad23 fix(openai-codex): avoid stale Responses replay state 2026-05-05 00:33:23 +01:00