Commit Graph

51854 Commits

Author SHA1 Message Date
Gio Della-Libera
4ffbd07c06 docs(policy): add policy rule reference tables (#85795) 2026-05-23 16:59:33 -07:00
Gio Della-Libera
1e2e614748 Policy: add tool posture conformance checks (#85482)
* feat(policy): add tool posture conformance

* fix(policy): attest tool alsoAllow posture
2026-05-23 16:44:42 -07:00
njuboy
a1eb765f0a fix(session-lock): enforce maxHoldMs in shouldReclaim during lock acquisition (#85764)
* fix(session-lock): enforce maxHoldMs in shouldReclaim during lock acquisition

- Adds optional maxHoldMs parameter to inspectLockPayload
- Inspect now marks locks as stale when held longer than maxHoldMs
- Passes maxHoldMs through inspectLockPayloadForSession
- acquireSessionWriteLock's shouldReclaim callback now passes maxHoldMs

This ensures that when a live process holds a lock for longer than
maxHoldMs (default 5min), other processes can reclaim it during
acquisition — matching the watchdog's existing enforcement.

Previously shouldReclaim only used staleMs (30min default), meaning
a lock held for 10+ minutes by a live PID would never be reclaimable,
causing 60s timeout failures and gateway freezes.

Closes #85762

* fix(session-lock): add dead-PID fast-path before retry loop

Adds a fast-path check at the top of acquireSessionWriteLock:
if the lock file's owner PID is dead, remove it immediately
before entering the retry loop. This saves up to timeoutMs (60s)
of futile waiting when the previous lock holder has died.

The shouldReclaim callback already handles this case, but only
iteratively through the retry loop. The fast-path eliminates
that unnecessary delay.

* fix(session-lock): enforce max hold during acquisition

* fix(session-lock): revalidate max hold safely

* fix(session-lock): honor holder max-hold policy

* fix(session-lock): keep cleanup from reclaiming live holders

* fix(session-lock): remove stale locks only when unchanged

* fix(session-lock): skip self-held max-hold reclaim

* fix(ci): refresh gateway protocol checks

---------

Co-authored-by: njuboy11 <njuboy11@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-24 00:38:01 +01:00
Peter Steinberger
a1c2d093c2 refactor: simplify channel catalog cache 2026-05-24 00:31:01 +01:00
Peter Steinberger
d4299dcbaa docs: codify gateway plugin metadata stability 2026-05-24 00:31:01 +01:00
Peter Steinberger
e5534dd2f3 perf: reduce gateway benchmark filesystem churn 2026-05-24 00:31:01 +01:00
Peter Steinberger
e2249d8d1e fix: order meeting notes startup around channels 2026-05-24 00:30:39 +01:00
Peter Steinberger
a0f6ce03ce fix: preserve sandbox skill overlay precedence (#85591) 2026-05-24 00:28:49 +01:00
Peter Steinberger
68487f494c fix: close remote sandbox skill symlink aliases (#85591) 2026-05-24 00:28:49 +01:00
Peter Steinberger
a8f68877a5 fix: guard remote sandbox skill roots (#85591) 2026-05-24 00:28:49 +01:00
Peter Steinberger
a3526789a4 fix: harden sandbox skill mounts (#85591) 2026-05-24 00:28:49 +01:00
Jason O'Neal
10942102e3 test(sandbox): allow remote writes under absent skill roots 2026-05-24 00:28:49 +01:00
Jason O'Neal
dd5fb1e71f fix(sandbox): filter remote skill mounts by existing roots 2026-05-24 00:28:49 +01:00
Jason O'Neal
07abb19431 test(sandbox): resolve skill roots read-only 2026-05-24 00:28:49 +01:00
Jason O'Neal
7152806950 fix(sandbox): block remote bridge writes to skills 2026-05-24 00:28:49 +01:00
Jason O'Neal
9e5b416130 fix(sandbox): block bridge writes to workspace skills 2026-05-24 00:28:49 +01:00
Jason O'Neal
1b7bf4a56f fix(sandbox): mount workspace skills read-only 2026-05-24 00:28:49 +01:00
Abdel Gomez-Perez
5c4a733912 fix(cli-runner): keep recent tail when reseed history exceeds maxHistoryChars (#83117)
* fix(cli-runner): keep recent tail when reseed history exceeds maxHistoryChars

`buildCliSessionHistoryPrompt` was prefix-slicing the rendered history,
dropping the most recent assistant turns from the reseed prompt. After
#80934 made the Claude-CLI reseed default-on, every Claude-CLI user is
exposed to this on session_expired when the rendered transcript exceeds
12288 chars. The truncation marker landed mid-word in real reproductions.

Fix:
- Tail-slice (keep the recent suffix, drop the older prefix)
- Pin the compaction summary as a prefix when present, only cap the
  post-summary transcript (loadCliSessionReseedMessages deliberately
  places the summary first)
- When the summary alone exceeds maxHistoryChars, head-slice the summary
  itself to honor the cap; drop the post-summary tail in that case
- Move the truncation marker to the lead since what follows is the
  recent tail, not what was dropped

Closes #83157

* fix(cli-runner): retain recent tail with oversize summaries

* fix(cli-runner): cap summary block plus marker against maxHistoryChars

ClawSweeper P2 on #83117 flagged that when `summaryRendered.length` is
less than `maxHistoryChars` but `summaryBlock.length` (summary + `\n\n`
separator) meets or exceeds it, the `remainingBudget <= 0` arm of
`buildCliSessionHistoryPrompt` appends the truncation marker after the
already-full summary block. A 199-char rendered summary under a 200-char
cap produced a 257-char history block — defeating the cap that prevents
reseeding fresh CLI sessions with unexpectedly huge prompts.

Fix the budget edge by truncating the summary in this branch as well so
`summary + separator + marker` stays within `maxHistoryChars`. The tail
still drops (the summary alone consumes the budget) and the marker still
leads its own line so the prompt announces what was discarded. Mirrors
the existing oversize-summary branch's pattern of head-slicing the
summary against an explicit budget that reserves marker + separator.

Add a focused regression in `session-history.test.ts` covering exactly
the gap the finding called out: `summaryRendered.length < maxHistoryChars`
with a non-empty post-summary tail. Asserts the rendered history block
stays within `maxHistoryChars` and the truncation marker is present.

* fix(cli-runner): keep tail for near-cap summaries

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-24 00:07:11 +01:00
Peter Steinberger
846f56642b docs: thank backup hardlink contributor (#83938) 2026-05-24 00:05:55 +01:00
Jason O'Neal
77d1157618 fix(backup): reject missing hardlink targets 2026-05-24 00:05:55 +01:00
Jason O'Neal
d8a2cd5204 fix(backup): dereference archive hardlinks 2026-05-24 00:05:55 +01:00
Peter Steinberger
d73f3ac85d refactor: split subagent delivery state 2026-05-24 00:05:48 +01:00
Peter Steinberger
3cf806d172 fix(telegram): cache outbound replies for context
Co-authored-by: Keshav's Bot <keshavbotagent@gmail.com>
2026-05-24 00:04:16 +01:00
Peter Steinberger
ec0e76792c docs: require blame-backed bug provenance 2026-05-24 00:02:22 +01:00
Jason O'Neal
cf70bdcceb fix(webchat): scope attachment button input 2026-05-23 23:59:48 +01:00
brokemac79
0c044596c5 fix(twitch): evict client manager on disconnect failure (#85796) 2026-05-23 23:58:55 +01:00
Youssef Hemimy
f0ec7309fc fix(whatsapp): serialize Error in auto-reply delivery log (#85777)
The auto-reply "delivery failed" log path passes a raw Error
under the `err` field. tslog's default JSON serialization
renders bare Error instances as `{}` because Error own data
properties are non-enumerable. Every delivery failure in
production therefore logs `err: {}`, forcing operators to
guess the underlying Baileys error from timestamp alone.

Convert Error to `{ type, message, stack }` plus own-enumerable
properties at the log site, so Boom-style subclass diagnostics
(output.statusCode, data) and custom OutboundDeliveryError
fields (stage, results) survive. Non-Error rejection values
pass through unchanged.

Tests cover Error, Error subclass (Boom-style), string
rejection, and object rejection paths.

AI-assisted: Claude Code (Opus 4.7) authored, codex review
locally addressed.
2026-05-23 23:58:51 +01:00
JC
0050245bc7 fix(gateway): omit stream-error placeholders from agent prompts (#85652)
* fix(gateway): omit stream-error placeholders from agent prompts

* fix(gateway): omit internal placeholder prompts

* fix(gateway): filter placeholder by role

* fix(gateway): preserve current prompt text

* test(plugin): align cold-boundary model normalization expectation

* fix(gateway): mark internal stream-error prompt entries

* fix(gateway): preserve empty tool prompt entries

* test(plugin): expect static xai normalization

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-23 23:58:47 +01:00
Peter Steinberger
bb947eed6c docs: add changelog for webchat tool result fix (#84773) 2026-05-23 23:55:10 +01:00
Jason O'Neal
83c2e96a16 fix: summarize internal webchat message tool results 2026-05-23 23:55:10 +01:00
Matthew Kern
a37ebb2d49 fix(browser): bypass managed proxy for loopback CDP
Keep browser CDP managed-proxy bypasses on the private bundled-plugin SSRF helper, strip WebSocket URL credentials before registering exact bypass URLs, and document the managed-browser loopback proxy behavior.

Co-authored-by: Matthew Kern <matthew@matthewkern.xyz>
2026-05-23 23:53:27 +01:00
Peter Steinberger
69e8039f9a fix: omit empty proxy tools (#85835) 2026-05-23 23:52:02 +01:00
rendrag-git
75081569b0 fix(agents): omit empty tools array for proxy-like openai-completions endpoints
Strict OpenAI-compatible servers (vLLM, LocalAI, llama.cpp, LM Studio) and
current OpenAI itself reject requests containing tools: []. Strip the empty
tools array (and the orphan tool_choice) from outbound chat-completions
payloads when usesExplicitProxyLikeEndpoint is true. Native OpenAI/Azure/
OpenRouter routes are byte-identical.

Supersedes #70790 at the canonical payload builder seam so the gateway,
embedded runner, and public plugin-SDK consumers (zai/xiaomi/deepseek) all
benefit.
2026-05-23 23:52:02 +01:00
Peter Steinberger
6394dd1ac5 fix: preserve gateway lifecycle error cleanup (#85256) (thanks @samzong) 2026-05-23 23:50:55 +01:00
samzong
bc2d501b1d fix(gateway): preserve lifecycle cleanup
Signed-off-by: samzong <samzong.lu@gmail.com>
2026-05-23 23:50:55 +01:00
samzong
9d56f4aa14 fix(gateway): preserve deferred lifecycle errors 2026-05-23 23:50:55 +01:00
Peter Steinberger
4cc2b293db ci: mount local installer scripts in smoke containers 2026-05-23 23:43:36 +01:00
Peter Steinberger
b52c31fe0e fix: speed up agent tool tests 2026-05-23 23:38:11 +01:00
Peter Steinberger
4314674054 perf: reuse plugin metadata snapshots (#85843)
* perf: reuse plugin metadata snapshots

* test: update plugin metadata snapshot mocks
2026-05-23 23:34:19 +01:00
Tyler Bea
45fbf2d81a fix(channels): honor /verbose in group sessions (#85488)
* codex: honor verbose in group dispatch

* codex: address group verbose review findings

Record the final local review pass for the group /verbose PR.

Codex review against origin/main completed clean after tightening the shared group progress gate, keeping public plugin hook types stable, preserving ACP hidden tool boundaries, and adding regressions for live verbose gating and progress-callback suppression.

* codex: require explicit group verbose progress

Normal group tool/progress summaries now require an explicit session verbose override instead of inherited agent verbose defaults.

This addresses the PR review concern that existing verboseDefault configurations could expose group progress after upgrade. DMs and forum-topic behavior continue to use the effective verbose state, while normal groups use the live explicit session verbose state set by /verbose on|full|off.

* codex: document Slack group verbose caveat

* fix(channels): simplify verbose progress gating

* docs(changelog): note verbose channel fix

* fix(channels): preserve quiet default for group progress

* fix(channels): keep verbose error policy dynamic

* fix(channels): default verbose progress off everywhere

* fix(channels): keep followup verbose default quiet

* fix(channels): latch visible tool-error progress

* fix(channels): track failed verbose progress events

* fix(channels): latch delivered tool errors

* fix(channels): prevent progress opt-out bypass

* fix(channels): isolate followup error warning state

* fix(channels): keep full verbose followup warnings

* fix(channels): latch tool errors after visible progress

* fix(channels): require visible followup failure progress

* fix(channels): refresh followup verbose state

* fix(channels): honor live verbose for error details

* test(channels): expect live verbose off warning mode

* fix(channels): preserve static tool error suppression semantics

* fix(channels): bypass acp for colon verbose commands

* fix(channels): narrow dynamic tool warning override

* fix(channels): gate compaction notices on live verbose

* fix(channels): suppress quiet followup compaction callbacks

* fix(channels): suppress tts for hidden tool summaries

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-23 23:14:11 +01:00
Peter Steinberger
2cd73d4c89 chore: sync autoreview skill snapshot 2026-05-23 23:10:40 +01:00
Peter Steinberger
1b68dbe95a test: isolate Codex replay timeout outcome 2026-05-23 23:06:41 +01:00
Peter Steinberger
32a80d9954 test: isolate Codex hook channel context 2026-05-23 22:55:52 +01:00
Peter Steinberger
f6204d081f test: isolate Codex duplicate terminal diagnostics 2026-05-23 22:45:19 +01:00
Peter Steinberger
fa5c8345f3 test: isolate Codex terminal diagnostic fallback 2026-05-23 22:34:39 +01:00
Jason (Json)
f603fa58fe fix(discord): keep forced voice consult diagnostics private (#84411)
Summary:
- The PR removes forced consult diagnostics from Discord and phone-call realtime consult payloads, adds private debug logs and regression tests, and records the fix in the changelog.
- Reproducibility: yes. by source inspection. Current main builds the forced Discord consult message with the  ... gent_consult` diagnostic string, and the phone-call fallback passes the same diagnostic as consult context.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(discord): log forced consult fallback reason
- PR branch already contained follow-up commit before automerge: fix(discord): keep forced voice consult diagnostics private

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

Prepared head SHA: c1592530c6
Review: https://github.com/openclaw/openclaw/pull/84411#issuecomment-4494164784

Co-authored-by: FullerStackDev <263060202+fuller-stack-dev@users.noreply.github.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: clawsweeper[bot] <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-23 21:33:23 +00:00
Peter Steinberger
a705a9c911 test: drain Codex app-server attempts 2026-05-23 22:24:25 +01:00
Gio Della-Libera
05c6e7a553 feat(agents): expose estimated context budget status
Expose a path-free estimated context budget status on session entries and gateway session rows, render it in status when fresh provider usage is unavailable, and clear stale estimates across reset, refresh, compaction, and session-rotation boundaries.

Verification: focused local Vitest covered session persistence, status rendering, gateway rows, model resets, compaction, and session rotation; GitHub CI passed on clean head cad199e43d.

Refs #80594, #54996, #77992, #84490, #83177, #43009, #83526, #8635.
2026-05-23 14:17:44 -07:00
Peter Steinberger
cd102efb70 test: isolate Codex native item release guard 2026-05-23 22:13:22 +01:00
Peter Steinberger
38e1654e09 fix: route Codex image API keys through OpenAI 2026-05-23 22:05:07 +01:00