Commit Graph

3183 Commits

Author SHA1 Message Date
Ayaan Zaidi 3ad465d32b fix(telegram): persist ambient transcript rows
Persist room-event observations as durable bare user transcript rows and carry an ambient transcript watermark through session state so Telegram chat windows only include the unpersisted gap.

Fixes #99257
2026-07-02 19:01:22 -07:00
Ayaan Zaidi 568be74e15 fix(auto-reply): trim inbound prompt metadata
Merge sender identity into conversation info, remove duplicate per-turn delivery hints, demote inbound metadata heading, keep room-event default-silent guidance singular, strip rendered chat-window context on replay, and refresh prompt snapshots.
2026-07-02 16:05:49 -07:00
Ted Li b67df3797a fix(telegram): explain disabled plugin approval failures (#95973)
* fix: explain disabled Telegram plugin approvals

* fix: handle disabled Telegram native plugin approvals

* fix: resolve exec approval surface independently

* fix: tie plugin approval setup guidance to plugin surface

* Revert "fix: tie plugin approval setup guidance to plugin surface"

This reverts commit 34e3c10e23ec8d3cf00ff803188df4226cd60f8d.

* fix: gate plugin approval setup guidance

* fix: gate plugin approval availability by delivery

* fix: preserve plugin approval approver auth

* fix: make plugin setup guidance explicit

* test: trim approval guidance proof radius

* Avoid setup guidance on routed approval timeout

* Carry plugin approval delivery route into timeouts

* Keep turn-source approval route visible

* fix(approvals): prefer delivered approval clients

* fix(approvals): prefer delivered approval clients

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-02 14:15:25 -07:00
Eva 46598a120f fix: OAuth refresh failures report reauth instead of stale success (#99134)
Fail closed when managed OpenAI OAuth refresh fails instead of silently falling back to stale external Codex CLI credentials.

Make managed provider OAuth authoritative after bootstrap, preserve API-key and non-OpenAI external CLI behavior, and surface targeted re-auth guidance without exposing profile IDs in group/channel replies.

Fixes #99120.

Co-authored-by: Eva <239388517+100yenadmin@users.noreply.github.com>
2026-07-02 13:50:25 -07:00
moguangyu5-design 826c84ea19 fix(config/sessions): narrow reply-session initialization revision to identity fields (#98835)
* fix(config/sessions): narrow reply-session initialization revision to identity fields

The initialization guard compared the full persisted session entry, so
background touches to updatedAt, heartbeat timestamps, context-budget
metadata, etc. produced false-positive stale-snapshot conflicts and the
"reply session initialization conflicted" error.

Only sessionId and sessionFile matter for detecting a session rotation.
Narrow the revision to those identity fields and add a regression test.

Fixes #98672

* fix(config/sessions): merge current metadata when reply-init identity guard passes

* fix(config/sessions): preserve only snapshot-drifted metadata in reply-init commit

* fix: preserve cleared reply-session metadata

* fix: allow same-session reply initialization drift

---------

Co-authored-by: moguangyu5-design <moguangyu5-design@users.noreply.github.com>
Co-authored-by: Josh Lehman <josh@martian.engineering>
2026-07-02 10:59:45 -07:00
Ayaan Zaidi 59a6240dae fix(auto-reply): default room events to silence 2026-07-02 09:12:35 -07:00
Ayaan Zaidi 4d5dac1836 fix(auto-reply): preserve ambient overflow summary kind 2026-07-02 08:53:10 -07:00
Ayaan Zaidi 519158c576 fix(auto-reply): suppress room-event followup notices 2026-07-02 08:53:10 -07:00
Ayaan Zaidi dbccddbf34 fix(auto-reply): suppress room-event fast progress dispatch 2026-07-02 08:53:10 -07:00
Ayaan Zaidi a5bf55d690 refactor(agents): fold assistant string normalization into transcript ingest (#98908) 2026-07-01 22:44:02 -07:00
Ayaan Zaidi b60803dfaa fix(auto-reply): persist heartbeat cli session bindings
Fixes #98895
2026-07-01 22:39:18 -07:00
Ayaan Zaidi 53fe2e4bc3 refactor(auth): simplify codex login follow-up 2026-07-01 11:16:49 -07:00
Josh Lehman 26a756ee84 fix: preserve plugin login command precedence 2026-07-01 11:16:49 -07:00
Josh Lehman bde0e4541e refactor: share codex login flow helpers 2026-07-01 11:16:49 -07:00
Eva 236626fffd Avoid object stringification in login surface checks 2026-07-01 11:16:49 -07:00
Eva af8a4540ed Address Codex login review feedback 2026-07-01 11:16:49 -07:00
Eva 48974b5765 Add shared Codex login command surfaces 2026-07-01 11:16:49 -07:00
Eva 77edfe7414 Add Telegram Codex login pairing 2026-07-01 11:16:49 -07:00
Eva 8d9a7ab2ca fix(reply): steer active non-streaming runs 2026-07-01 10:34:20 -07:00
Eva bfc4e1dcb5 fix(telegram): restore active-run steering 2026-07-01 10:34:20 -07:00
Ayaan Zaidi 4895a00b94 fix(usage): tidy compact footer defaults 2026-07-01 09:59:37 -07:00
Peter Lindsey 2205bf9d24 test(usage): update default footer expectations 2026-07-01 09:59:37 -07:00
Moeed Ahmed c99add65a2 fix(reply): honor suppressToolErrors for progress
5.22 already drops the tool-error WARNING text via payloads.ts, but the
error tool-result payload was still delivered as channel progress unless
sourceReplyDeliveryMode was message_tool_only. Operators who opt into
messages.suppressToolErrors expect no tool-error noise in chat at all.
Add a config-gated early-return in the onToolResult dispatch path so the
visible progress delivery is dropped too, matching the warning-text policy.
No-op unless messages.suppressToolErrors is true. Folds the mac-mini deploy
hotfix into the tracked branch.

(cherry picked from commit a973410e6d3ddbbaa4c3fb308ad4247274a9633a)

Co-authored-by: amittell <mittell@me.com>
2026-07-01 04:15:23 -07:00
Yzx 7b8f50d229 fix: report codex chatgpt status auth (#91240) 2026-07-01 01:23:21 -07:00
Vincent Koc 8516018956 refactor(sessions): centralize export transcript parsing 2026-07-01 00:48:20 -07:00
Ben Badejo 180a970ac0 fix(heartbeat): scope commitment fan-out prompts (#98169)
* fix(heartbeat): scope commitment fan-out prompts

* fix(heartbeat): isolate commitment fan-out runs

* fix(heartbeat): isolate commitment fan-out runs

---------

Co-authored-by: Benjamin Badejo <ben@benbadejo.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-06-30 20:25:28 -07:00
Yuval Dinodia 54e6afdc29 fix(auto-reply): stop level directives from eating the next message word (#97929)
matchLevelDirective consumed the token after a level directive
(/think, /verbose, /trace, /fast, /reasoning, /elevated) as the level
argument unconditionally, and extractLevelDirective stripped it from the
body whether or not it was a valid level. So a message like
"/verbose explain quantum computing" reached the agent as
"quantum computing", silently dropping the user's first word, and the
whitespace scan crossed newlines so "/verbose\nSummarize this" lost
"Summarize".

Treat the trailing token as the directive argument only when it
normalizes to a valid level or is the sole remaining token (preserving
the unrecognized-level hint and the default/inherit clear sentinels).
When two or more words follow, the directive acts argument-less and the
message text is preserved intact, matching the exec and queue parsers
that stop at an unrecognized token.
2026-06-30 18:51:51 -07:00
Marvinthebored b3b51b0c91 fix(anthropic): surface Discord pre-tool commentary
Route Anthropic pre-tool narration through the commentary progress lane, preserve shared channel progress defaults, and keep Discord/Telegram reasoning gates explicit.

Thanks @Marvinthebored!
2026-06-30 18:12:07 -07:00
Peter Lee 856cd1824c test: migrate leaky raw mkdtemp calls to createSuiteTempRootTracker() (#96058)
Gap finding: tempdir-8h9i0j1k, tempdir-9i0j1k2l

Replace bare fs.mkdtemp/mkdtempSync calls in 4 test files with the
shared createSuiteTempRootTracker() helper, adding proper cleanup
where none existed.

Background: the project has standardized on shared temp dir helpers
since 88b87d893d (withTempDir) -> 13df67ebc8 (createSuiteTempRootTracker)
-> 06431fd99b / #87298 (CI guard + docs guidance). This PR continues
that migration for the highest-risk files.

Files changed:
- src/skills/lifecycle/install-fallback.test.ts: variable overwrite risk
- src/auto-reply/reply/session-hooks-context.test.ts: helper leaks temp dirs
- src/auto-reply/reply/abort.test.ts: createAbortConfig leaks root dir
- src/auto-reply/inbound.test.ts: test cases without cleanup

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 17:43:28 -07:00
xingzhou 29371cfe1f fix #96840: [Bug]: Targetless message.send fails with 'Action send requires a target' in WebChat despite docs stating source-reply sink should handle it (#97167)
* fix(message): route WebChat sends to source sink

* fix(webchat): preserve message tool source replies

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-06-30 17:34:26 -07:00
Agustin Rivera b885c81479 fix(mcp): require owner for Claude permission replies (#98256)
* fix(mcp): require owner for Claude permission replies

* fix(mcp): prove owner-gated permission replies
2026-06-30 13:58:02 -07:00
Masato Hoshino a75431c586 fix(agents): classify Anthropic orphaned tool-use replay errors (#98163) 2026-06-30 09:57:14 -07:00
Pavan Kumar Gondhi 6cb82eaab8 fix: require owner for trajectory export (#97840) 2026-06-30 16:59:50 +05:30
Pavan Kumar Gondhi 3d4b7cade9 fix: gate group activation changes by owner (#97838) 2026-06-30 13:56:56 +05:30
Agustin Rivera 72f837a4a4 fix(codex): require admin for native controls (#97952)
* fix(codex): require admin for native controls

Gate Codex native session controls and bound turns on current owner or operator.admin authority. Preserve gateway scope precedence and read-only status behavior.

* fix(codex): align native authorization

* fix(codex): preserve silent bound handling

* fix(codex): narrow bound auth contract

* fix(docs): refresh generated docs map
2026-06-29 20:41:28 -07:00
Jason (Json) 455f813d6e fix(telegram): deliver durable reasoning when enabled
Preserve shared reasoning suppression by default while letting Telegram opt into durable reasoning payloads only when it has a deliverable reasoning lane. Covers persistent /reasoning on, separate reasoning stream lanes, and progress-stream suppression.\n\nVerification:\n- node scripts/run-vitest.mjs src/auto-reply/reply/dispatch-from-config.test.ts extensions/telegram/src/bot-message-dispatch.test.ts\n- git diff --check upstream/main...HEAD\n- .agents/skills/autoreview/scripts/autoreview --mode branch --base upstream/main --stream-engine-output\n- CI run 28411526182 green, including QA Smoke CI and check-test-types\n- Real behavior proof run 28411676681 passed\n\nPR: #97875
2026-06-29 17:31:06 -07:00
Agustin Rivera 6ead092302 fix(acp): require owner for runtime controls (#97953) 2026-06-29 17:29:08 -07:00
Josh Avant 7c47904bb4 Stage managed inbound media for runner access (#97647) 2026-06-28 22:40:42 -05:00
Dallin Romney 938855082a fix(reply): clear 'model unavailable' reply + correct operator hint for retired runtime models (#97611)
* fix(models): don't advise models.providers[] registration for runtime-bound models

When an agent's configured model is bound to an agent runtime (e.g. the
"codex" runtime, whose catalog comes from the OpenAI ChatGPT-account
app-server), and that model id is no longer offered by the runtime, model
resolution fails with "Unknown model: <provider>/<model>". The appended hint
told users to register the model in models.providers[].models[].

For runtime-owned models that advice is misleading: adding the registration
makes resolution "succeed" only for the request to be rejected later by the
provider — e.g. OpenAI returns 400 "model is not supported when using Codex
with a ChatGPT account" once a model id such as gpt-5.3-codex is deprecated.

Detect the agentRuntime binding on the configured agents.defaults.models entry
and instead point the user at the runtime's live catalog (openclaw models list
--provider <id>) and at switching the configured default to an available model.

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

* fix(reply): show a clear "model unavailable" reply instead of generic failure

When a configured model is retired/renamed by the provider, model resolution
fails (run.ts throws a typed FailoverError with reason "model_not_found") and
the agent runner falls back to the generic "Something went wrong … use /new"
reply. That copy is actively misleading for this failure: retrying or starting
a new session can never help, because the model id itself must be changed in
config. Users on a deprecated model (e.g. gpt-5.3-codex on a Codex ChatGPT
account) just see the generic message on every message and on /new.

Classify this failure into a dedicated user-facing reply that explains the
model is unavailable and points at the config. Detection is structural — it
keys off the typed FailoverError reason, not provider error text — so it stays
robust as provider wording changes; free-text rejections without a typed reason
remain the responsibility of the failover layer that owns error classification.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 19:02:21 -07:00
QiuYuang 820fadc3f2 fix(template): resolve variable shadowing in export-html template 2026-06-28 18:51:29 -07:00
linhongkuan 69b0604f31 fix(telegram): expose sender bot status in context (#96810)
* fix(telegram): expose sender bot status in context

* chore: retrigger PR checks

---------

Co-authored-by: lin-hongkuan <lin-hongkuan@users.noreply.github.com>
2026-06-28 18:40:06 -07:00
Jerry-Xin 6f90ee4cb8 fix: recover terminal session status on visible inbound turns (#89045)
* fix: recover terminal session status on visible inbound turns (#86827)

When a group chat session enters a terminal status (failed/timeout/killed),
subsequent visible inbound messages now automatically recover the session by
clearing stale lifecycle fields while preserving the session ID and transcript
continuity.

Changes:
- session.ts: detect terminal status on visible turns and clear status/
  startedAt/endedAt/runtimeMs/abortedLastRun without rotating sessionId
- dispatch-from-config.ts: force-clear stale active reply operations for
  terminal sessions and retry admission once
- agent.ts: mirror terminal recovery in the agent API dispatch path
- kernel.ts: add zero-count visible dispatch warning diagnostic
- types.ts: add 'warning' to ChannelTurnLogEvent event union

* fix: guard terminal recovery from concurrent force-clear race

When two visible messages arrive against the same terminal session
snapshot, the second turn could force-fail the first turn's freshly
admitted recovery operation, dropping the very message the recovery
path exists to save.

Add a terminalRecovery flag on ReplyOperation that is set after a
recovery turn clears the proven stale leftover and admits its own
operation. The force-clear branch now skips operations marked as
in-flight terminal recoveries, letting concurrent turns fall through
to normal busy/wait handling instead.

Add a two-turn regression test that gates the first recovery turn
open, races a second visible turn against the same terminal snapshot,
and asserts neither turn's operation is incorrectly killed.

Also fix missing FinalizedMsgContext import in kernel.ts.

* fix: avoid return value in Promise executor to satisfy lint

* fix: gate terminal force-clear to visible reply turns

A heartbeat/control turn can pass the early active-run short-circuit, reach
the terminal force-clear branch, and abort an in-flight visible recovery
operation that a concurrent visible turn just admitted (before that op is
marked terminalRecovery). Gate the force-clear to visible reply turns so
non-visible turns fall through to normal busy/skip handling instead of
killing the recovery they are meant to protect.

Adds a focused regression test exercising a heartbeat turn that reaches the
force-clear branch against a terminal session snapshot with an active
recovery operation present; it must leave that operation intact and skip.

* fix: verify session identity before terminal force-clear

* fix: mark clean no-stale terminal recovery to survive concurrent visible turn

The same-session terminal-recovery race could still drop a reply when two
visible turns raced the same failed snapshot. The terminalRecovery marker was
set only on the post-force-clear re-admission path, never on the clean no-stale
admission path. So when the first turn admitted cleanly (no stale op to clear),
its recovery op stayed terminalRecovery=false and a second concurrent visible
turn force-cleared it, dropping the first reply (#86827).

Consolidate marking to the single owned-admission choke point that both the
clean no-stale admission and the re-admission-after-force-clear flow through.
Genuine stale leftovers from the original failed run never pass through this
admission, so they stay unmarked and remain force-clearable.

Add a no-stale regression twin to the existing stale-race test.

* fix: suppress zero-count visible-dispatch warning for observed-delivery turns

maybeWarnZeroCountVisibleDispatch re-implemented a partial visibility
check that omitted observedReplyDelivery, so visible turns delivered via
the observed-delivery path (queuedFinal=false, zero counts,
observedReplyDelivery=true) falsely tripped the silent-drop sentinel and
emitted a bogus zero-count-visible-dispatch warning/event.

Use the canonical hasVisibleChannelTurnDispatch helper for the warning
suppression so all non-count delivery paths (observedReplyDelivery,
fallback, summary, queuedFinal) are honored. Add regression tests
covering the observed-delivery case (no warning) and a genuinely empty
visible dispatch (still warns).

* test: read persisted session store in failed-group recovery test

---------

Co-authored-by: 忻役 <xinyi@mininglamp.com>
2026-06-28 15:45:37 -07:00
snowzlmbot 8d168c836a fix(agents): preserve structured tool result visible text (#97268)
* fix(agents): preserve structured tool result visible text

* fix(agents): address structured tool result review blockers

* fix(agents): cover real structured tool result shapes

* fix(agents): preserve canonical tool error statuses

* fix(agents): harden structured result rendering

* fix(agents): preserve typed structured results

* fix(agents): bound provider result media

---------

Co-authored-by: snowzlmbot <293528334+snowzlmbot@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@golden-gate.local>
2026-06-28 02:38:43 -07:00
Josh Avant 07b934901a fix: scanned PDF pages reach chat vision models (#97354)
* fix: forward scanned PDF page images to chat models

* fix: remove stale reply option cast
2026-06-27 23:01:08 -05:00
Andy Ye 830467bc93 fix(imessage): stage remote media for plugin claims (#91803) 2026-06-27 19:36:21 -07:00
zengLingbiao 1b8b8500ce fix(auto-reply): truncate user-facing text on UTF-16 boundary (#97299)
Summary:
- The PR imports `truncateUtf16Safe` and uses it for the Codex usage-limit preview and verbose working-label truncation paths in auto-reply.
- PR surface: Source +2. Total +2 across 2 files.
- Reproducibility: yes. Current main uses raw `slice(0, N)` at both reported user-facing truncation sites, and ... ludes terminal before/after output showing dangling surrogates before the fix and safe truncation after it.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

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

Prepared head SHA: 74a0a32ed9
Review: https://github.com/openclaw/openclaw/pull/97299#issuecomment-4820038635

Co-authored-by: zenglingbiao <zeng.lingbiao@xydigit.com>
Approved-by: takhoffman
2026-06-27 20:39:32 +00:00
Josh Avant 6f1076351c fix: defer active implicit session rollover (#97164) 2026-06-26 22:42:45 -05:00
pick-cat 6db4624f43 fix(auth): suppress recovery hint for format failures (#95779)
* fix(auth): suppress recovery hint for format failures

* test(auth): cover format failure recovery copy

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-06-27 00:27:25 +01:00
Jesse Merhi ec737ee74d fix: rebase clawhub install trust (#81364) 2026-06-26 18:33:19 +10:00
brokemac79 a0b397748f fix(status): restore Codex synthetic usage in status 2026-06-25 17:37:30 -07:00