Commit Graph

346 Commits

Author SHA1 Message Date
Peter Steinberger
a957ba6c2d test: tighten tui launch assertions 2026-05-09 13:13:18 +01:00
Peter Steinberger
f35993b426 test: tighten embedded tui event assertions 2026-05-09 07:29:06 +01:00
Shakker
e2d8b78b69 test: tighten daemon infra array assertions 2026-05-09 05:56:26 +01:00
Shakker
e771e251eb test: tighten core io empty array assertions 2026-05-09 05:29:45 +01:00
Shakker
2a272aa4a8 test: tighten shared empty object assertions 2026-05-09 04:13:56 +01:00
Peter Steinberger
ce515dbf4d test: avoid misc count filter allocations 2026-05-08 22:05:41 +01:00
Peter Steinberger
16c54655d3 test: require common deferred callbacks 2026-05-08 19:20:42 +01:00
Peter Steinberger
5c589673ec test: clarify loose boolean assertions 2026-05-08 14:00:34 +01:00
Peter Steinberger
8221f0914a test: clarify small core accepted assertions 2026-05-08 13:37:09 +01:00
Peter Steinberger
ea2799389a test: clarify proxy tui cli accepted paths 2026-05-08 12:47:48 +01:00
Peter Steinberger
f9812e6cba test: clarify tui list assertions 2026-05-08 09:16:07 +01:00
Peter Steinberger
9ef37d1907 test: tighten assertions and harness coverage 2026-05-08 05:28:12 +01:00
Peter Steinberger
610e882dbf fix(openrouter): canonicalize auto selector refs 2026-05-07 05:48:14 +01:00
Jesse Merhi
5b00cd1ae1 fix: narrow Gateway proxy bypass target (#77018)
* fix: narrow Gateway proxy bypass target

* fix: narrow Gateway proxy bypass target

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (1)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (2)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (validation-3)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (4-final)

* fix: narrow Gateway proxy bypass target

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (1)

* fix(clawsweeper): address review for automerge-openclaw-openclaw-77018 (2)

* fix(clawsweeper): reconcile automerge-openclaw-openclaw-77018 with main (1)

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-06 14:40:31 +10:00
Peter Steinberger
538605ff44 [codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives

* refactor: use fs-safe for file access helpers

* refactor: reuse fs-safe for media reads

* refactor: use fs-safe for image reads

* refactor: reuse fs-safe in qqbot media opener

* refactor: reuse fs-safe for local media checks

* refactor: consume cleaner fs-safe api

* refactor: align fs-safe json option names

* fix: preserve fs-safe migration contracts

* refactor: use fs-safe primitive subpaths

* refactor: use grouped fs-safe subpaths

* refactor: align fs-safe api usage

* refactor: adapt private state store api

* chore: refresh proof gate

* refactor: follow fs-safe json api split

* refactor: follow reduced fs-safe surface

* build: default fs-safe python helper off

* fix: preserve fs-safe plugin sdk aliases

* refactor: consolidate fs-safe usage

* refactor: unify fs-safe store usage

* refactor: trim fs-safe temp workspace usage

* refactor: hide low-level fs-safe primitives

* build: use published fs-safe package

* fix: preserve outbound recovery durability after rebase

* chore: refresh pr checks
2026-05-06 02:15:17 +01:00
Vincent Koc
5af1fe1bd0 fix(tui): prevent orphaned terminal sessions (#77662)
* fix(tui): prevent orphaned terminal sessions

* fix(doctor): repair heartbeat-poisoned main sessions

* fix(tui): preserve startup tls respawn

* fix: harden tui and doctor recovery paths
2026-05-05 16:34:18 -07:00
Vincent Koc
42d8255ce9 fix(tui): bound session list recency (#77752) 2026-05-05 01:25:43 -07:00
Dallin Romney
fc1f1f4fdf fix(tui): preserve code spans, code blocks, and dotted/hyphenated identifiers from long-token sanitizer (#77335)
The display sanitizer's long-token chunker (`\S{33,}` -> 32-char chunks
joined by spaces) was injecting literal spaces inside inline code spans,
fenced code blocks, and bare identifiers it didn't recognize. Tokens like
`requireConfirmationForMutatingActions`, `ubuntu-budgie-desktop-environment`,
and `binary_sensor.sense_energy_monitor_power` rendered with mid-word
spaces, contaminating copy/paste of package names, entity IDs, and shell
line-continuations.

Fix:

- Make sanitizer code-aware: split text into fenced/inline-code segments
  and prose, and only run the chunker on prose segments. Code regions
  pass through verbatim.
- Widen `isCopySensitiveToken` to use the punctuation-stripped candidate
  for all classification, and accept any `FILE_LIKE_RE` token that
  contains `_`, `-`, or `.` (covers package names, dotted IDs, kebab
  flags). Picks up the goals of #69340 and #39565.
- Skip chunking for symbol-only runs (box-drawing rows, dashes, equals)
  so table borders aren't corrupted.
- Preserve the original goal of narrow-terminal protection: long
  unidentifiable prose tokens (e.g. accidental base64 dumps) are still
  chunked so they don't blow out terminal layout.

Security ordering preserved: ANSI strip / control-char strip / binary
redaction still run on the whole string before segmentation, so code
regions cannot smuggle escapes, control characters, or binary garbage
past the sanitizer.

16 new regression tests cover: camelCase config keys in inline code,
hyphenated package names (bare and in code), dotted entity IDs (bare
and in code), backtick and tilde fenced blocks, base64-like blobs in
code, prose-token chunking unchanged, prose-around-code mixed content,
box-drawing horizontal rules, multi-line shell `\\` continuations,
plus three explicit security-ordering tests asserting ANSI/control/
binary stripping still runs inside code segments.

Fixes #48432, #39505.
Supersedes #69340, #39565 (carries forward both ideas in a more
general fix). Carries forward the code-fence-aware approach from the
closed #48445.
2026-05-04 21:50:40 +08:00
Dallin Romney
5f373ae4d3 fix(tui): abort run during pre-event waiting gap (#77199)
* fix(tui): abort run during pre-event waiting gap

Track the runId returned from chat.send so pressing Esc while `activeChatRunId` is still null aborts the in-flight run instead of repeatedly printing "no active run". Identified in #1296.

* fix(tui): drop redundant comment on pendingChatRunId set
2026-05-04 21:36:52 +08:00
Peter Steinberger
a224810a7f fix(gateway): bound sessions list responses
Bound default Gateway sessions.list responses to 100 rows when callers omit limit, with response metadata for totalCount, limitApplied, and hasMore.\n\nFixes #77062.
2026-05-04 06:51:56 +01:00
Dave Morin
1df6226d90 TUI: simplify stale response notice (#77120) 2026-05-03 22:50:24 -07:00
Peter Steinberger
2805bbd3d7 feat(commands): add side alias for btw 2026-05-03 18:22:20 +01:00
Peter Steinberger
e0a83c0046 test: fix tui command completion typecheck 2026-05-03 13:03:11 +01:00
Alex Knight
54a81e0080 fix: expose session-specific thinking levels (#76548)
* fix: expose session-specific thinking levels (#76482)

* fix: preserve lightweight sessions.list contract, fix consumer-side fallbacks only

* fix: include thinking levels in lightweight session rows for Control UI (#76482)

The Control UI cannot resolve provider-specific thinking levels client-side
(ui/src/ui/thinking.ts always returns base 5 levels). The gateway must
provide them even in lightweight rows. listThinkingLevelOptions is a cheap
in-memory lookup — negligible perf impact vs the transcript/cost/model ops
that the lightweight flag still skips.

Also update existing test assertions that expected thinkingOptions: [] for
lightweight rows (flagged by ClawSweeper review).

* test: add e2e regression tests for thinking level pipeline (#76482)
2026-05-03 21:38:32 +10:00
Josh Avant
86cc29274e Wizard: bound hatch TUI timeout (#76241)
* Wizard: bound hatch TUI timeout

* Scripts: avoid control regex in hatch stall repro

* Scripts: remove hatch stall repro harness

* Changelog: note hatch timeout fix

* Changelog: use PR reference for hatch timeout
2026-05-02 15:28:32 -05:00
Peter Steinberger
4d9c658f40 perf: bound async transcript history reads (#75977)
Summary:
- The PR bounds async transcript history reads and shares async transcript-index builds across gateway history, embedded/TUI history, restart recovery, fork token checks, and preflight compaction paths.
- Reproducibility: not applicable. this is a performance PR rather than a user bug report. The verification pa ... ource review plus the added unit coverage for bounded reads, usage snapshots, and concurrent index sharing.

ClawSweeper fixups:
- No separate fixup commits were needed after automerge opt-in.

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

Prepared head SHA: ccfe33658c
Review: https://github.com/openclaw/openclaw/pull/75977#issuecomment-4363170293

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-02 06:36:01 +00:00
Peter Steinberger
7f13a43ebb refactor: hide utility helper internals 2026-05-02 07:33:06 +01:00
Val Alexander
cb9d7884cc fix(ui): preserve local session continuity (#75948)
Fixes #63195.
Closes #68162.
Closes #73546.

- Keep Control UI chat sends bound to the history-backed session id across reconnects.
- Accept chat.send sessionId at the gateway/protocol boundary and update generated Swift models.
- Resume the last selected TUI session for the same gateway/agent/scope when still present.

Validated by exact-SHA CI on PR #75948.
2026-05-02 00:08:01 -05:00
Peter Steinberger
6147e1b91d fix(gateway): async session transcript IO (#75875)
* fix(gateway): async session transcript IO

* fix(plugins): restore jiti loader cache helper

* test(gateway): mock async artifact transcript reads

* chore(plugins): drop obsolete jiti loader shim
2026-05-02 02:06:38 +01:00
Peter Steinberger
2ea00e1c35 refactor: delete unused repo scan helper 2026-05-01 12:48:46 +01:00
jacky
0544c6d493 fix: suppress raw JSON parse errors from leaking to Discord channels (#59076) [AI-assisted] (#59118)
Merged via squash.

Prepared head SHA: b8b3686445
Co-authored-by: singleGanghood <156392444+singleGanghood@users.noreply.github.com>
Co-authored-by: hxy91819 <8814856+hxy91819@users.noreply.github.com>
Reviewed-by: @hxy91819
2026-04-29 21:59:46 +08:00
Peter Steinberger
6bbacd14a3 fix(gateway): wait for event loop before client start 2026-04-29 14:50:44 +01:00
Peter Steinberger
8f6c72823e fix(ci): repair main typecheck after merges 2026-04-29 12:22:42 +01:00
Roger Deng
d4e52f4542 fix(tui): resync streaming watchdog after reconnect (#74224)
* fix(tui): resync streaming watchdog after reconnect

* fix(tui): keep reconnect history fallback armed

* fix(tui): tighten reconnect watchdog recovery
2026-04-29 07:17:18 -04:00
Vincent Koc
6d7a77dcf9 fix(tui): recover stale streaming status after unbound final (#73749)
* fix(tui): clear stale streaming after unbound final events

* fix(clownfish): address review for ghcrawl-156749-autonomous-smoke (1)

* fix(tui): address stale streaming review
2026-04-29 04:12:25 -07:00
Peter Steinberger
7994833fac fix(gateway): align handshake client timeouts 2026-04-29 05:53:50 +01:00
Peter Steinberger
db40ec404a fix: honor Ollama thinking catalog metadata 2026-04-28 09:15:28 +01:00
Scott Hanselman
146debf8c1 fix(tui): dedupe ASCII backspace events (#73335)
Merged via squash.

Prepared head SHA: 8f02f48acd
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Reviewed-by: @shanselman
2026-04-28 00:41:55 -07:00
Vincent Koc
d7e67b455a fix(tui): clear stale streaming after orphaned finals (#72389)
* fix(tui): clear stale streaming after orphaned finals

* fix(tui): clear stale streaming after orphaned finals

* fix(tui): clear stale streaming after orphaned finals
2026-04-27 22:23:13 -07:00
Peter Steinberger
7f3f108521 refactor(config): migrate plugin config access 2026-04-27 12:35:58 +01:00
Peter Steinberger
5f2273e81e fix(gateway): unify chat display projection 2026-04-26 05:33:58 +01:00
kevinlin-openai
289ed9830a Add TUI context mode selector (#71760)
Co-authored-by: kevinlin-openai <kevin@dendron.so>
Co-authored-by: Codex <noreply@openai.com>
2026-04-25 17:16:03 -04:00
Peter Steinberger
385da2db60 feat: run Crestodian in TUI shell 2026-04-25 10:59:49 +01:00
Peter Steinberger
2011de69d3 feat: add Crestodian setup helper 2026-04-25 08:58:21 +01:00
Vincent Koc
06d46869f8 refactor(tui): remove cli-highlight dependency
Remove direct cli-highlight usage from the TUI renderer and drop the now-unused root ownership record.
2026-04-24 09:25:25 -07:00
Peter Steinberger
e880eab486 test(tui): narrow embedded backend mocks 2026-04-23 10:05:32 +01:00
Peter Steinberger
596b88986d chore: apply core lint cleanups 2026-04-23 05:30:49 +01:00
fuller-stack-dev
276c00015c fix: add local embedded TUI mode (#66767) (thanks @fuller-stack-dev)
* feat(tui): add local embedded TUI mode with terminal/chat aliases

Adds a gateway-free local TUI path so users can run openclaw in their
terminal without needing a running gateway process.

- TuiBackend interface abstraction (tui-backend.ts) with EmbeddedTuiBackend
  implementation that drives the agent loop in-process
- openclaw tui --local flag for local embedded mode
- openclaw terminal / openclaw chat aliases that imply --local
- /auth slash command with codex CLI delegation to avoid prolite plan issue
- Default model display fallback on startup
- Local-aware status text and log suppression
- Concise auth error hints, raw HTML 403 suppression
- Onboarding hatch flow launches local TUI (no gateway required)
- Commander alias bug fix in run-main.ts (.aliases() check)
- All new and updated tests passing (145/145)

* TUI: fix alias detection, cross-platform codex lookup, and history byte-budget safeguards

* TUI: remove RuntimeEnv type annotation to fix CI oxlint error

* TUI: filter gateway-dependent tools and auto-approve plugin hooks in embedded mode

* TUI: suppress console noise and add embedded mode system prompt note

* TUI: reduce embedded-mode tool filtering from 15 to 7, add local session tools

* TUI: fix remaining PR review comments

* TUI: address latest review feedback and CI drift

* Core: align prompt helper with latest base

* Core: match prompt helper formatting with base

* Core: restore prompt helper from latest base

* fix(tui): preserve local auth fallback in source checkouts

* fix(tts): guard telephony provider invocation

* fix(tui): support Windows codex auth shim

* fix(tui): harden local auth flow

* fix: preserve embedded tool-first run events

* fix(tui): keep embedded plugin approvals gated

* fix(tui): restore embedded attempt import

* fix(tui): resolve sessions in embedded stub

* fix: add embedded TUI changelog entry (#66767) (thanks @fuller-stack-dev)

* fix: pass setup TUI local mode through relaunch (#66767) (thanks @fuller-stack-dev)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-22 10:08:57 +05:30
Cássio Jones Dhein Silva
89b6d02481 fix(tui): arm streaming watchdog on every delta, not only visible ones (#69338)
When ingestDelta returns null (first empty/commentary delta or unchanged
content), the handler returned early, skipping setActivityStatus and
armStreamingWatchdog. If all subsequent deltas were also null (e.g.
due to phase filtering), the watchdog was never armed and the status bar
stayed stale as "idle" while a run was live.

Move setActivityStatus("streaming") and armStreamingWatchdog before
the null-displayText guard so they fire on every received delta event.

Fixes #34513, #40824

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 21:53:36 +10:00
Shakker
aae4b1b29d Fix setup TUI hatch terminal handoff (#69524)
* fix: relaunch setup tui in a fresh process

* fix: harden setup tui handoff

* fix: preserve tui hatch exit flow

* Revert "fix: preserve tui hatch exit flow"

This reverts commit f4f119a5a3.

* fix: let setup tui resolve gateway auth

* fix: support packaged tui relaunch

* fix: pin setup tui gateway target

* fix: preserve setup tui auth source
2026-04-21 03:45:57 +01:00