Skip to content

feat(linux): Quick Chat floating composer for the Tauri companion - #109947

Merged
steipete merged 2 commits into
mainfrom
claude/quick-chat-tauri
Jul 17, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/quick-chat-tauri

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Linux/Tauri companion has no quick way to message the agent — every interaction goes through the full dashboard. This is the cross-platform sibling of the macOS Quick Chat bar (#109720): a summonable floating composer that fires a message at the default agent's main session and gets out of the way.

Why This Change Was Made

First deliberately minimal step, matching the shell's existing architecture (CLI delegation, static frontend, on-demand windows):

  • Window: frameless, transparent, always-on-top quickchat webview created on demand (same pattern as the Canvas window), centered on the cursor's monitor with its top edge at ~22% of the work area, excluded from window-state restoration. CSS-driven fade+zoom in/out (140ms/100ms) with a JS↔Rust hide handshake; hides on Escape, focus loss, close-request, successful send, or toggle.
  • Entry points: Ctrl+Shift+Space global shortcut on X11 (Alt+Space is GNOME's window-menu grab and can never be registered; the existing X11-only gate applies — the plugin's Linux backend doesn't support Wayland) and a Quick Chat tray item that works everywhere including Wayland. The existing CmdOrCtrl+Shift+O dashboard shortcut is untouched; the handler now dispatches by shortcut identity.
  • Send path: a window-scoped quickchat_send command runs openclaw agent --message-file <owner-only tmp> --session-key main --json detached — the message is staged in a 0600 file and deleted after the turn because argv is world-readable through procfs and an agent turn can run for minutes. The bar shows the accepted state immediately; a failed turn surfaces as a desktop notification with the first stderr line. Ctrl+Enter additionally opens the dashboard.
  • Identity chip: quickchat_identity resolves the default agent from openclaw agents list --json (60s cache) and renders emoji or a hue-hashed monogram with a "Message " placeholder.
  • Security posture: all five commands verify the calling window label; the new capability is scoped to the quickchat window with its own permission set; no permission strip on Linux (no TCC equivalent), and no accessibility/window-capture features in this first step by design.

User Impact

Linux companion users get a keyboard-first composer for the main session. Replies stay in the normal session (dashboard). No changes to existing windows, shortcuts, or gateway behavior.

Release-note context: feat(linux): Quick Chat floating composer — Ctrl+Shift+Space (X11) or tray item, sends to the main session via the CLI.

Evidence

  • Structured autoreview (Codex gpt-5.6-sol, xhigh): three passes; accepted findings fixed (procfs argv exposure → --message-file with 0600 staging and cleanup incl. partial-write failure; GNOME-reserved Alt+Space default replaced; staged-file cleanup on every error path); final pass clean — "no accepted/actionable findings".
  • CLI contracts verified against source: agents list --json emits identityName/identityEmoji/isDefault (src/commands/agents.commands.list.ts); agent --message-file/--session-key flags and bare-key default-agent resolution (src/cli/program/register.agent-turn.ts, src/agents/command/session.ts). Shortcut::matches verified in the vendored plugin's upstream source.
  • Rust unit tests cover the placement math and default-identity selection.
  • No Rust toolchain on the author host: the linux-app CI lane (cargo fmt --check + full Tauri bundle build on ubuntu) is the compile/build gate for this PR. Runtime verification on a real Linux desktop is a follow-up; the feature is additive and cannot affect existing shell behavior when unused.

- frameless transparent always-on-top quickchat window (on-demand, canvas
  pattern), positioned top-third on the cursor monitor, CSS fade+zoom in/out
- global shortcut Ctrl+Shift+Space on X11 (GNOME reserves Alt+Space); tray
  'Quick Chat' item is the Wayland entry point; blur/Esc/close-request hide
- sends via the CLI agent turn with --message-file staged 0600 (argv is
  world-readable procfs) and cleaned up after the turn; failures surface as
  desktop notifications; Ctrl+Enter also opens the dashboard
- default-agent identity chip (emoji/monogram) from agents list --json, 60s cache
- window-scoped capability + permission set; window-state denylist; docs
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: linux plugin: linux-node size: L maintainer Maintainer-authored PR labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: feat(linux): Quick Chat floating composer for the Tauri companion This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a1161ff01

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// agent turn can keep running for minutes, so the text must never appear in `--message`.
fn write_message_file(message: &str) -> Result<PathBuf, String> {
use std::io::Write;
use std::os::unix::fs::OpenOptionsExt;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard Unix-only temp-file permissions for Windows bundles

When release operators set desktop-test-bundles=true, .github/workflows/linux-app-release.yml runs the build_windows job and builds this same apps/linux/src-tauri crate as an NSIS bundle. Because quickchat.rs is compiled unconditionally and this function imports std::os::unix::fs::OpenOptionsExt (and then calls .mode(0o600)), the Windows Rust target cannot compile the module. Gate the Unix-only permission setting or use a cross-platform temp-file creation path so the optional Windows desktop test bundle keeps building.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed July 17, 2026, 7:30 AM ET / 11:30 UTC.

Summary
Adds a Linux Tauri Quick Chat floating composer with X11 shortcut and tray entry points, CLI-backed main-session sending, default-agent identity, scoped Tauri permissions, static UI assets, tests, and Linux documentation.

PR surface: Docs +8, Other +889. Total +897 across 11 files.

Reproducibility: not applicable. as an issue reproduction because this is a new feature PR. The Windows compile failure is source-reproducible from the unconditional Unix-only API use and the existing Windows bundle workflow.

Review metrics: 2 noteworthy metrics.

  • New privileged command surface: 5 Tauri commands in 1 window-scoped capability. The identity, send, hide, ready, and dashboard commands expand the native bridge and must remain restricted to the Quick Chat window.
  • Cross-platform build regression: 1 optional Windows bundle target blocked. The shared Tauri crate is built by the desktop test-bundle workflow, so Linux-only imports cannot remain unconditional.

Stored data model
Persistent data-model change detected: persistent cache schema: apps/linux/src-tauri/src/quickchat.rs. Confirm migration or upgrade compatibility proof before merge.

Merge readiness
Overall: 🧂 unranked krab
Proof: 🧂 unranked krab
Patch quality: 🦐 gold shrimp
Result: blocked until real behavior proof is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Fix the Windows-target compile failure without weakening Unix message-file permissions.
  • [P1] Add redacted real Linux desktop proof covering summon, send, hide, and failure handling.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR explicitly defers real Linux runtime verification; add redacted screenshots, a recording, terminal output, or logs showing the changed desktop flow, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Risk before merge

  • [P1] The optional Windows desktop test bundle cannot compile while Unix-only file-permission APIs remain in the unconditionally compiled Tauri module.
  • [P1] No real Linux desktop evidence shows that X11 registration, Wayland tray access, focus-loss hiding, main-session delivery, or failed-turn notification behavior works after the change.

Maintainer options:

  1. Fix staging and prove Linux behavior (recommended)
    Gate Unix-only permission code or use a secure cross-platform temporary-file path, then add real Linux desktop evidence before merging.

Next step before merge

  • [P1] Require the contributor to repair the cross-target Rust compile path and supply real Linux behavior proof, then perform human review because the PR carries the protected maintainer label.

Security
Cleared: The design restricts commands to the Quick Chat window, adds a dedicated capability, avoids message text in process arguments, and introduces no new dependency or workflow execution source; no concrete security regression is evident.

Review findings

  • [P2] Gate the Unix-only temporary-file permission code — apps/linux/src-tauri/src/quickchat.rs:1
Review details

Best possible solution:

Keep the on-demand Tauri window and existing CLI delegation, but make secure message-file staging compile across every supported bundle target, then provide redacted real Linux proof for the X11 shortcut, Wayland tray, successful main-session send, dismissal, and failed-turn notification behavior.

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

Not applicable as an issue reproduction because this is a new feature PR. The Windows compile failure is source-reproducible from the unconditional Unix-only API use and the existing Windows bundle workflow.

Is this the best way to solve the issue?

Mostly yes: an on-demand Tauri window using the companion's existing CLI delegation is the narrowest architectural fit, but it is not the best mergeable implementation until secure temporary-file staging is cross-target and the real Linux flow is proven.

Full review comments:

  • [P2] Gate the Unix-only temporary-file permission code — apps/linux/src-tauri/src/quickchat.rs:1
    The same Tauri crate is built for the optional Windows desktop test bundle, but this added module unconditionally imports std::os::unix::fs::OpenOptionsExt and calls .mode(0o600), so that target cannot compile. Put the Unix permission handling behind cfg(unix) or use a secure cross-platform staging helper while preserving owner-only permissions on Unix.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label changes:

  • add P2: This is a bounded Linux desktop feature with a normal-priority compile blocker and no evidence of a shipped-user regression.
  • add merge-risk: 🚨 compatibility: Merging the unguarded Unix-only Rust code can break the repository's optional Windows desktop bundle build path.
  • add rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR explicitly defers real Linux runtime verification; add redacted screenshots, a recording, terminal output, or logs showing the changed desktop flow, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.

Label justifications:

  • P2: This is a bounded Linux desktop feature with a normal-priority compile blocker and no evidence of a shipped-user regression.
  • merge-risk: 🚨 compatibility: Merging the unguarded Unix-only Rust code can break the repository's optional Windows desktop bundle build path.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR explicitly defers real Linux runtime verification; add redacted screenshots, a recording, terminal output, or logs showing the changed desktop flow, then update the PR body to trigger review or ask a maintainer for @clawsweeper re-review.
Evidence reviewed

PR surface:

Docs +8, Other +889. Total +897 across 11 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 2 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 9 893 4 +889
Total 11 901 4 +897

What I checked:

  • Current-main gap: Current main's Linux companion documentation and source do not include Quick Chat; the feature exists only in this PR's added Quick Chat module and assets. Public docs: docs/platforms/linux.md. (docs/platforms/linux.md:49, c3f552628585)
  • Unfixed cross-target compile blocker: The added module uses Unix-only OpenOptionsExt and mode(0o600) unconditionally, while the optional desktop-test-bundles path builds the same Tauri crate for Windows; the existing review identifies that the Windows target cannot compile this module. (apps/linux/src-tauri/src/quickchat.rs:1, 47c4f8aa4286)
  • Finding remains on current head: The only commit after the reviewed feature commit changes the knip native-asset entry, so quickchat.rs was not updated after the Windows compile finding. (config/knip.config.ts:154, 47c4f8aa4286)
  • Real behavior proof gap: The PR body states that runtime verification on a real Linux desktop is a follow-up; unit tests, autoreview, and build CI do not demonstrate the shortcut, tray, send, hide, or notification flow in a real setup. (47c4f8aa4286)
  • Adjacent product precedent: The merged macOS Quick Chat implementation explicitly named a Tauri cross-platform follow-up, supporting the product direction without superseding the Linux-specific implementation. (1859cdb23138)

Likely related people:

  • steipete: The merged macOS Quick Chat work established the cross-platform feature direction, giving this person relevant merged history beyond merely opening this PR. (role: feature owner and recent adjacent contributor; confidence: high; commits: 1859cdb23138; files: apps/linux/src-tauri/src/quickchat.rs, apps/linux/src-tauri/src/main.rs, docs/platforms/linux.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Runtime proof from a Linux desktop environment (Ubuntu 24.04 container, Xvfb + openbox + picom, X11): the composer was summoned with the real registered global shortcut (Ctrl+Shift+Space injected via xdotool) and typed into normally.

State Screenshot
Summoned over the companion window empty
Typed message, accent send button typed

Full desktop context: tauri-quickchat-full.png

Notes: the agent chip shows the monogram fallback ("A"/Agent) because the shell's first-run CLI install state hadn't settled in the container — the identity path itself is verified against openclaw agents list --json (returns the configured name/emoji) and covered by the Rust unit tests. Window transparency requires a compositor, as on any real desktop.

@steipete
steipete merged commit 277f009 into main Jul 17, 2026
122 of 125 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the claude/quick-chat-tauri branch July 17, 2026 17:25
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…enclaw#109947)

* feat(linux): add Quick Chat floating composer to the Tauri companion

- frameless transparent always-on-top quickchat window (on-demand, canvas
  pattern), positioned top-third on the cursor monitor, CSS fade+zoom in/out
- global shortcut Ctrl+Shift+Space on X11 (GNOME reserves Alt+Space); tray
  'Quick Chat' item is the Wayland entry point; blur/Esc/close-request hide
- sends via the CLI agent turn with --message-file staged 0600 (argv is
  world-readable procfs) and cleaned up after the turn; failures surface as
  desktop notifications; Ctrl+Enter also opens the dashboard
- default-agent identity chip (emoji/monogram) from agents list --json, 60s cache
- window-scoped capability + permission set; window-state denylist; docs

* chore(linux): register quickchat.js as a knip native-asset entry
steipete added a commit that referenced this pull request Jul 27, 2026
* fix(linux): restore the macOS build of the Tauri companion

Tauri gates `WebviewWindowBuilder::transparent` behind its `macos-private-api`
feature on macOS, so the companion stopped compiling for macOS when Quick Chat
landed in #109947: `no method named 'transparent' found for struct
'WebviewWindowBuilder'`. Enable that feature together with the matching
`app.macOSPrivateApi` config flag, which Tauri requires to agree with it or
tauri-build fails the allowlist check.

Quick Chat is built for a transparent window - quickchat.css makes html and
body transparent behind a 16px-radius translucent card with a drop shadow - so
compiling macOS by dropping `.transparent(true)` would ship an opaque rectangle
instead of the floating composer.

Also add a per-PR macOS `cargo check`. The only job that compiled the macOS
target sits behind a manual dispatch input in linux-app-release.yml, which is
why a broken macOS build survived for nine days.

* ci(linux): build the macOS companion on macos-15

tauri-plugin-notifications' Swift sources use typed throws
(`throws(FFIResult)`), which requires Swift 6. The macos-14 runner image still
ships Swift 5.x and cannot parse them, so the plugin's build script panics with
"Swift build failed for target: arm64-apple-macosx13.0".

This hit the new per-PR check immediately, and it means the release workflow's
`build_macos` job could not have produced a macOS bundle either - it compiles
the same crate on the same image, but only runs behind a manual dispatch input
so nothing surfaced it. Move both to macos-15.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 27, 2026
…114243)

* fix(linux): restore the macOS build of the Tauri companion

Tauri gates `WebviewWindowBuilder::transparent` behind its `macos-private-api`
feature on macOS, so the companion stopped compiling for macOS when Quick Chat
landed in openclaw#109947: `no method named 'transparent' found for struct
'WebviewWindowBuilder'`. Enable that feature together with the matching
`app.macOSPrivateApi` config flag, which Tauri requires to agree with it or
tauri-build fails the allowlist check.

Quick Chat is built for a transparent window - quickchat.css makes html and
body transparent behind a 16px-radius translucent card with a drop shadow - so
compiling macOS by dropping `.transparent(true)` would ship an opaque rectangle
instead of the floating composer.

Also add a per-PR macOS `cargo check`. The only job that compiled the macOS
target sits behind a manual dispatch input in linux-app-release.yml, which is
why a broken macOS build survived for nine days.

* ci(linux): build the macOS companion on macos-15

tauri-plugin-notifications' Swift sources use typed throws
(`throws(FFIResult)`), which requires Swift 6. The macos-14 runner image still
ships Swift 5.x and cannot parse them, so the plugin's build script panics with
"Swift build failed for target: arm64-apple-macosx13.0".

This hit the new per-PR check immediately, and it means the release workflow's
`build_macos` job could not have produced a macOS bundle either - it compiles
the same crate on the same image, but only runs behind a manual dispatch input
so nothing surfaced it. Move both to macos-15.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: linux docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. plugin: linux-node rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant