Skip to content

fix(tui): show agent-scoped session example - #130519

Merged
vincentkoc merged 1 commit into
openclaw:mainfrom
bdjben:codex/tui-session-key-example
Aug 27, 2026
Merged

vincentkoc merged 1 commit into
openclaw:mainfrom
bdjben:codex/tui-session-key-example

Conversation

@bdjben

@bdjben bdjben commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users running openclaw tui with multiple explicitly owned agents would be told to pass an agent-scoped --session key without being shown the supported syntax. The incomplete hint can lead users to try unsupported --agentId or --agent options.

Why This Change Was Made

The TUI-specific startup diagnostic now includes the supported pattern: openclaw tui --session agent:agentname:main. This changes display text only; CLI options, agent resolution, session parsing, and fallback behavior remain unchanged.

AI-assisted: yes.

User Impact

Users can act on the startup error directly instead of guessing unsupported flags.

Evidence

Before (installed OpenClaw 2026.8.1 development cut at ad24304):

Multiple agents are configured, but TUI startup has no explicit owner. Pass an agent-scoped --session key.

After (isolated checkout, using a synthetic two-agent configuration):

Multiple agents are configured, but TUI startup has no explicit owner. Pass an agent-scoped --session key (e.g., 'openclaw tui --session agent:agentname:main').
  • pnpm test src/tui/tui.test.ts -- --reporter=dot — 88 tests passed on the rebased PR commit
  • pnpm check:changed -- src/tui/tui.ts src/tui/tui.test.ts — passed the classified core and core-test checks
  • pnpm build — passed
  • autoreview --mode uncommitted — clean, with no accepted/actionable findings

@bdjben
bdjben marked this pull request as ready for review August 27, 2026 00:20
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 27, 2026
@clawsweeper

clawsweeper Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 8:25 PM ET / August 27, 2026, 00:25 UTC.

ClawSweeper review

What this changes

This PR adds a pasteable agent-scoped session-key example to the TUI’s multi-agent startup error and updates the matching behavior assertion.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

The patch is a focused, behaviorally aligned diagnostic correction with no concrete defect found. Keep it open for a rebase and exact-head review because this checkout could not hydrate the differing current-main TUI files.

Priority: P3
Reviewed head: e2ae55b0c2f9feceec07c65578ca9e8c1630fd54

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A small, coherent patch with direct terminal evidence and a behavior-level assertion; current-main rebase review remains outstanding because local hydration failed.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.
Evidence reviewed 6 items Changed owner boundary: The startup resolver is reached by the real TUI runtime before connection setup and formats the selection-required hint at the same boundary that detects an ownerless explicit fleet.
Supported syntax contract: The session parser accepts an agent-prefixed key and returns its agent owner; the CLI documents literal agent session keys and the TUI accepts a session key through --session.
Regression assertion: The updated test constructs two explicitly owned agents outside either workspace and checks the complete operator-facing selection error, which would fail before this text change.
Findings None None.
Security None None.

Live Verification

Command: d="$(mktemp -d)"; trap 'rm -rf "$d"' EXIT; printf '%s\n' '{"agents":{"ownership":"explicit","list":[{"id":"main","workspace":"/tmp/main"},{"id":"ops","workspace":"/tmp/ops"}]}}' › "$d/openclaw.json"; OPENCLAW_CONFIG_PATH="$d/openclaw.json" pnpm openclaw tui

Result: FAIL (failed) — step 1 run d="$(mktemp -d)"; trap 'rm -rf "$d"' EXIT; printf '%s\n' '{"agents":{"ownership":"explicit","list":[{"id":"main","workspace":"/tmp/main"},{"id":"ops","workspace":"/tmp/ops"}]}}' › "$d/openclaw.json"; OPENCLAW_CONFIG_PATH="$d/openclaw.json" pnpm openclaw tui: terminal run was blocked by the previous command: terminal command failed with exit status 1: "d=\"$(mktemp -d)\"; trap 'rm -rf \"$d\"' EXIT; printf '%s\\n' '{\"agents\":{\"ownership\":\"explicit\",\"list\":[{\"id\":\"main\",\"workspace\":\"/tmp/main\"},{\"id\":\"ops\",\"workspace\":\"/tmp/ops\"}]}}' › \"$d/openclaw.json\"; OPENCLAW_CONFIG_PATH=\"$d/openclaw.json\" pnpm openclaw tui"

$ node scripts/run-node.mjs tui
[openclaw] Building TypeScript (dist is stale: missing_build_stamp - build stamp missing).
[openclaw] Building bundled plugin assets.
[canvas] build: node scripts/bundle-a2ui.mjs
[log] ‹DIR›/a2ui.bundle.js  chunk │ size: 399.96 kB
[log] ‹DIR›/a2ui-v0.9.bundle.js  chunk │ size: 615.66 kB
[log]
[success] rolldown v1.2.0 Finished in 99.18 ms
[diffs] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts curated
[diffs-language-pack] build: node --import tsx ../../scripts/build-diffs-viewer-runtime.mts full
[discord] build: node --import tsx ../../scripts/build-discord-activity-sdk.mts
[tsdown-build] invocation 1/2 finished in 0.7s
node_modules/playwright-core/lib/coreBundle.js (65821:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65821:29 ]
       │
 65821 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/playwright-core/lib/coreBundle.js (65828:28) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
       ╭─[ node_modules/playwright-core/lib/coreBundle.js:65828:29 ]
       │
 65828 │               const value = eval(ˋ(${expr})ˋ);
       │                             ──┬─
       │                               ╰─── Use of direct ˋevalˋ here.
       │
       │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2343:30) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2343:31 ]
      │
 2343 │           ASM_CONSTS[start] = eval(func);
      │                               ──┬─
      │                                 ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

node_modules/web-tree-sitter/web-tree-sitter.js (2366:32) [EVAL] Use of direct ˋevalˋ function is strongly discouraged as it poses security risks and may cause
issues with minification.
      ╭─[ node_modules/web-tree-sitter/web-tree-sitter.js:2366:33 ]
      │
 2366 │           moduleExports[name] = eval(func);
      │                                 ──┬─
      │                                   ╰─── Use of direct ˋevalˋ here.
      │
      │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
──────╯

[tsdown-build] invocation 2/2 finished in 13.4s
[plugin-control-plane-loads] verified 36 built modules with native require and checked doctor closures
runtime-postbuild: 11 phases completed in 4081ms (slowest: built plugin control-plane loads 3355ms)
│
◇

OpenClaw 2026.8.1 (e2ae55b) — Your task has been queued; your dignity has been deprecated.

│
◇  Config warnings ─────────────────────────────────────────────────────────────────────────╮
│                                                                                           │
│  - agents.defaults.heartbeat.agentId: Multi-agent config has no ambient heartbeat owner;  │
│    heartbeats stay disabled until agents.defaults.heartbeat.agentId or                    │
│    agents.defaults.systemAgent.agentId is set.                                            │
│  - agents.entries: Moved agents.list to keyed agents.en
… output truncated …

Assertions:

  • FAIL expect_output: Pass an agent-scoped --session key (e.g., 'openclaw tui --session agent:agentname:main').

How this fits together

The TUI resolves an initial agent from an explicit session key, configured defaults, or the working directory before connecting to a Gateway. When an explicitly owned multi-agent setup has no resolvable owner, it stops with a diagnostic that now shows the supported session-key form.

flowchart LR
  A[Operator starts terminal UI] --> B[TUI command and options]
  B --> C[Initial agent selection]
  C --> D{Explicit owner resolved?}
  D -- Yes --> E[Open selected session]
  D -- No --> F[Selection-required diagnostic]
  F --> G[Agent-scoped session example]
Loading

Before merge

  • Resolve merge risk (P1) - The branch is behind main, and the local promisor checkout could not retrieve current-main TUI source; rebase and exact-head review are needed before merge.
  • Complete next step (P2) - No repair lane is needed; the remaining action is routine rebase and exact-head validation.
Agent review details

Security

None.

PR surface

Source 0, Tests -1. Total -1 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 1 2 -1
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 2 3 -1

Review metrics

Metric Value Why it matters
Production versus test LOC production +1/-1 (net 0), tests +1/-2 (net -1) The behavior change reuses the existing command formatter and replaces a type-only assertion with the user-visible diagnostic contract.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Preserve this owner-boundary diagnostic, rebase it onto current main, and verify the displayed command still matches the session-key grammar before merging.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Preserve this owner-boundary diagnostic, rebase it onto current main, and verify the displayed command still matches the session-key grammar before merging.

Do we have a high-confidence way to reproduce the issue?

Yes—an explicit two-agent configuration outside either agent workspace reaches this diagnostic, and the PR records before/after terminal output; I did not execute untrusted contributor code locally.

Is this the best way to solve the issue?

Yes—the change improves the error at the startup selection owner using the already-supported session-key grammar and existing command formatter, without adding a competing flag or fallback.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 162e8d139404.

Labels

Label changes:

  • add P3: This is low-blast-radius terminal guidance that reduces user guesswork without changing routing, session state, or CLI semantics.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.

Label justifications:

  • P3: This is low-blast-radius terminal guidance that reduces user guesswork without changing routing, session state, or CLI semantics.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body supplies before/after terminal output from an isolated two-agent setup that directly shows the changed diagnostic; redact local paths or other private details in any future proof.

Evidence

What I checked:

  • Changed owner boundary: The startup resolver is reached by the real TUI runtime before connection setup and formats the selection-required hint at the same boundary that detects an ownerless explicit fleet. (src/tui/tui.ts:260, e2ae55b0c2f9)
  • Supported syntax contract: The session parser accepts an agent-prefixed key and returns its agent owner; the CLI documents literal agent session keys and the TUI accepts a session key through --session. (src/sessions/session-key-utils.ts:259, e2ae55b0c2f9)
  • Regression assertion: The updated test constructs two explicitly owned agents outside either workspace and checks the complete operator-facing selection error, which would fail before this text change. (src/tui/tui.test.ts:380, e2ae55b0c2f9)
  • Provided real behavior proof: The PR body includes before/after terminal output from a synthetic two-agent configuration, plus a targeted test run, changed check, and build on the PR commit. (e2ae55b0c2f9)
  • Area history: History shows Peter Steinberger as the dominant contributor to the TUI file and a recent TUI/session-routing maintainer; this supports routing rather than regression attribution. (src/tui/tui.ts:260, 97c0455add24)
  • Current-main inspection gap: Current-main tree entries for both touched files differ from the PR head, but attempting to hydrate the current-main source failed because this promisor checkout could not reach its remote. (162e8d139404)

Likely related people:

  • steipete: TUI file history is heavily concentrated in Peter Steinberger’s commits, including recent session-routing work. (role: recent TUI contributor; confidence: high; commits: 97c0455add24, 1ca60fbc3a3f; files: src/tui/tui.ts, src/tui/tui.test.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@vincentkoc vincentkoc self-assigned this Aug 27, 2026
@vincentkoc

Copy link
Copy Markdown
Member

Land-ready review completed on exact head e2ae55b0c2f9feceec07c65578ca9e8c1630fd54.

  • No blocking findings. Production +1/-1 (net 0); tests +1/-2.
  • Confirmed the TUI error owner and caller, the accepted agent:<agentId>:<rest> session grammar, and the focused operator-visible assertion.
  • Current main is b8d2ac735a87a6745685b91381dc4b5db41c474e; both touched file blobs are byte-identical to the PR base, so the stale rebase request does not apply.
  • Latest ClawSweeper review covers this head, reports no findings, has no Rank-up moves, and accepts the recorded before/after TUI output as sufficient real-behavior proof.
  • Exact-head CI is green: 206 passing, 49 skipped, zero failed or pending. openclaw/ci-gate passed in https://github.com/openclaw/openclaw/actions/runs/33026491072/job/98372407626.
  • Native review artifacts validated. OPENCLAW_TESTBOX=1 scripts/pr prepare-run 130519 passed using the exact hosted gate, and scripts/pr merge-verify 130519 passed.

Commands run:

scripts/pr review-init 130519
scripts/pr review-checkout-main 130519
scripts/pr review-checkout-pr 130519
scripts/pr review-artifacts-init 130519
scripts/pr review-validate-artifacts 130519
OPENCLAW_TESTBOX=1 scripts/pr prepare-run 130519
scripts/pr merge-verify 130519

Known proof gap: no contributor-branch scripts or tests were executed locally during review; the external fork remained isolated. Exact-head hosted CI, the focused contributor evidence, and ClawSweeper's accepted live output cover this bounded diagnostic-only change.

@vincentkoc
vincentkoc merged commit 2f1ea32 into openclaw:main Aug 27, 2026
326 checks passed
@vincentkoc

Copy link
Copy Markdown
Member

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants