Skip to content

fix(chat): make Enter send from the multiline composer - #1674

Merged
RomneyDa merged 1 commit into
mainfrom
openclaw/pr-to-fix-the-issue
Oct 7, 2026
Merged

RomneyDa merged 1 commit into
mainfrom
openclaw/pr-to-fix-the-issue

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Fixes Companion chat inserting a newline when users press Enter, despite advertising Enter to send.

User Impact

Enter sends the draft. Shift+Enter continues to insert a newline, and slash-command selection retains precedence.

Why This Change Was Made

Handle composer shortcuts in PreviewKeyDown, before the multiline WinUI TextBox consumes Enter. Draft/send/slash workflow ownership remains in the existing view model and controller; the composer remains the native keyboard adapter.

Evidence

The existing native-keyboard theory covers five caret/selection positions, Shift+Enter, typed text and exact submitted content. Extended it to verify a second Enter after sending neither sends again nor inserts an empty newline, and to capture the post-send state.

Rubber-duck review: no blocking findings. Verified preview-event choice, slash shortcut precedence, Shift+Enter preservation and post-render empty-draft assertions.

Change Type

  • Bug fix
  • Tests or validation

Scope

  • Tray or WinUI UX
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: native Enter/Shift+Enter routing requires the real WinUI TextBox and an interactive foreground desktop.

Validation

CI retry on unchanged head

The first hosted UI job hung in WinUI test-host bootstrap before any tray UI test completed, then the five-minute inactivity watchdog aborted it. Retried failed jobs without changing bfcdc10176910b98972f9717aa0e32d0b49400e7.

Build and Test attempt 2 passed, including CI Gate:

  • WinUI and UI-test project builds: passed.
  • Functional UI tests: 19 passed, 0 failed.
  • Tray UI tests: 464 passed, 0 failed, 19 skipped (483 total).
  • Accessibility tests: 23 passed, 0 failed.
  • The previously successful Tray/setup/integration and fast-validation jobs were retained.

No source changes or test exclusions were needed. Native-keyboard theory remains skipped in hosted CI, so this does not fulfill the interactive proof pool. A new Crabbox acquisition attempt still failed with fleet capacity 21/20; no lease was issued. C# security was still running at this update.

  • git diff --check: passed.
  • dotnet build tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: passed on macOS, 0 warnings/errors.
  • dotnet build tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: passed on macOS, 0 warnings/errors. These builds do not compile the changed WinUI composer or UI theory.
  • pwsh -NoProfile -File ./build.ps1: blocked, reports This project requires Windows.
  • pwsh -NoProfile -File ./scripts/setup-dev.ps1 -CheckOnly: blocked, reports OpenClaw Windows development requires Windows.
  • OPENCLAW_REPO_ROOT="$PWD" dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: macOS diagnostic run failed, 4,127 passed, 135 failed, 35 skipped (4,297 total). Windows-dependent path, execution and IPC behavior fails on this host. This is not native Windows closeout validation.
  • OPENCLAW_REPO_ROOT="$PWD" OPENCLAW_TRAY_DATA_DIR=/tmp/chat-enter-tray-tests dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: macOS diagnostic run failed, 3,892 passed, 102 failed, 2 skipped (3,996 total). Failures include Windows-style source paths, Windows DPAPI and Windows IPC. This is not native Windows closeout validation.
  • OPENCLAW_REPO_ROOT="$PWD" OPENCLAW_TRAY_DATA_DIR=/tmp/chat-enter-focused-tests dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --filter "FullyQualifiedName~ChatComposer|FullyQualifiedName~ChatRootComposerClosureTests": 109 passed, 0 failed, 0 skipped. Covers existing composer/controller policies, not native key routing.
  • Native Windows validation acquisition attempted twice using crabbox warmup --provider azure --target windows --windows-mode normal --desktop --keep --idle-timeout 90m --ttl 240m --timing-json. Both rejected with HTTP 429 cost_limit_exceeded, fleet active lease limit exceeded: 21/20. No lease ID or run URL was issued; no cloud lease requires cleanup.

Real Behavior Proof

  • Environment tested: macOS controller; native Windows proof blocked by fleet capacity.
  • PR head: bfcdc101.
  • Exact pending command on an isolated interactive Windows desktop: dotnet test tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -r win-x64 --filter FullyQualifiedName~ComposerInput_NativeKeyboardPreservesCaretAndEnterSends, with OPENCLAW_RUN_KEYBOARD_PROOF=1, OPENCLAW_REPO_ROOT pointing to this checkout, and isolated tray data/appdata/localappdata roots. Enable OPENCLAW_VISUAL_TEST=1 and OPENCLAW_VISUAL_TEST_DIR for captures.
  • Evidence after fix: Not verified / blocked. The keyboard theory and captures have not run; hosted CI's default skipped keyboard theory is not native input proof.
  • Screenshot/artifact links verified: N/A, no captures claimed.
  • Required Windows closeout remains pending: ./build.ps1, Shared tests and Tray tests with --no-restore after building fresh test projects.

Security Impact

No new permissions, credentials, network calls, command execution or data access.

Compatibility and Migration

Backward compatible. No configuration changes or migration.

@RomneyDa RomneyDa added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@RomneyDa
RomneyDa marked this pull request as ready for review October 7, 2026 22:27
@RomneyDa RomneyDa removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 7, 2026
@RomneyDa
RomneyDa marked this pull request as draft October 7, 2026 22:27
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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 Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex review: needs changes before merge. Reviewed October 7, 2026, 6:43 PM ET / 22:43 UTC (Revision 2).

ClawSweeper review

What this changes

The PR handles chat keyboard shortcuts before the multiline text box consumes Enter and adds a native keyboard assertion that pressing Enter again leaves the cleared draft unchanged.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This remains a useful focused fix absent from current main. No blocking code defect was found, and the member-authored PR is protected from automatic closure.

Priority: P2
Reviewed head: bfcdc10176910b98972f9717aa0e32d0b49400e7

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, source-sound repair with useful native assertions; required Windows validation remains outstanding.
Proof confidence 🌊 off-meta tidepool Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Repository-specific Windows validation remains pending: the real composer’s PreviewKeyDown path has not been exercised after the fix, and the captured body explicitly reports the interactive pool as blocked. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Repository-specific Windows validation remains pending: the real composer’s PreviewKeyDown path has not been exercised after the fix, and the captured body explicitly reports the interactive pool as blocked. No stored-data contract changes.
Evidence reviewed 9 items Verified introduced change: The pinned base-to-head diff changes only the composer event registration from bubbling KeyDown to PreviewKeyDown and adds post-send keyboard assertions. Existing slash precedence, Shift handling, and controller ownership remain intact.
Current main still needs the change: Current main registers OnKeyDown on the multiline composer. The supplied latest release points to this same main revision, so neither current main nor that release contains the preview-event repair.
Native keyboard coverage: The existing five-case theory injects native keyboard input into the real foreground WinUI composer, checks Shift+Enter caret behavior and exact submitted content, and now checks a second Enter after clearing. Its provider records submissions; it does not establish live Gateway delivery. The theory skips unless OPENCLAW_RUN_KEYBOARD_PROOF=1.
Findings None None.
Security None None.

How this fits together

Companion’s native chat composer receives keyboard input and forwards draft and send actions to the existing chat controller. The controller admits submissions, sends them through the chat provider, and clears accepted drafts.

flowchart TD
  A[Keyboard input] --> B[Native chat composer]
  B --> C{Shortcut selection}
  C --> D[Slash command selection]
  C --> E[Shift Enter inserts newline]
  C --> F[Enter requests send]
  F --> G[Chat controller and provider]
Loading

Before merge

  • Complete next step (P2) - Complete ./build.ps1 and the required Shared/Tray tests on Windows, then run ComposerInput_NativeKeyboardPreservesCaretAndEnterSends with OPENCLAW_RUN_KEYBOARD_PROOF=1 on an isolated interactive desktop against this head. Record non-skipped results for Enter, Shift+Enter, and repeated Enter; verify slash-selection precedence and attach redacted output or captures.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +3/-1; tests +11/-0 Production growth documents the native event-order invariant; the test growth checks empty-draft behavior after sending.

Technical review

Best possible solution:

Keep keyboard interception in the native composer while preserving the existing slash-selection, draft, and send owners.

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

No high-confidence runtime reproduction was established. Current main uses the bubbling handler on a multiline text box, and the existing opt-in native keyboard theory provides a focused check, but its Windows run remains blocked.

Is this the best way to solve the issue?

Yes, source inspection supports preview-event interception as a focused repair that preserves native Shift+Enter handling and existing slash precedence. Actual WinUI routing still needs the declared interactive validation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2ba89f377ce8.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This repairs a bounded chat keyboard interaction with an established Enter-to-send contract.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The ordinary external-contributor proof gate does not apply to this MEMBER-authored PR. Repository-specific Windows validation remains pending: the real composer’s PreviewKeyDown path has not been exercised after the fix, and the captured body explicitly reports the interactive pool as blocked. No stored-data contract changes.

Evidence

What I checked:

  • Verified introduced change: The pinned base-to-head diff changes only the composer event registration from bubbling KeyDown to PreviewKeyDown and adds post-send keyboard assertions. Existing slash precedence, Shift handling, and controller ownership remain intact. (src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs:412, bfcdc1017691)
  • Current main still needs the change: Current main registers OnKeyDown on the multiline composer. The supplied latest release points to this same main revision, so neither current main nor that release contains the preview-event repair. (src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs:410, 2ba89f377ce8)
  • Native keyboard coverage: The existing five-case theory injects native keyboard input into the real foreground WinUI composer, checks Shift+Enter caret behavior and exact submitted content, and now checks a second Enter after clearing. Its provider records submissions; it does not establish live Gateway delivery. The theory skips unless OPENCLAW_RUN_KEYBOARD_PROOF=1. (tests/OpenClaw.Tray.UITests/ReactorChatLayoutProofTests.cs:437, bfcdc1017691)
  • Existing send safeguards: The unchanged controller rejects empty submissions and uses a single-flight gate; the view model also disables sending an empty draft without attachments. Moving keyboard interception does not introduce a parallel send owner or change authorization. (src/OpenClaw.Tray.WinUI/Chat/ChatComposerController.cs:157, bfcdc1017691)
  • Validation remains explicitly blocked: The captured PR body reports 109 passing focused policy tests, but states that the changed WinUI composer and keyboard theory were not compiled or exercised by those runs. Required Windows closeout remains pending. Two reported Azure acquisition attempts returned fleet-capacity errors without a lease or run URL; no native captures are claimed. (bfcdc1017691)
  • Applicable proof policy: The fully read root policy requires build, Shared tests, and Tray tests. The proof-pool documentation distinguishes an interactive pool declaration from completed proof and requires unavailable capacity to remain explicitly blocked. (docs/PROOF_POOLS.md:48, bfcdc1017691)

Likely related people:

  • karkarl: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • bkudiess: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record the required Windows build and Shared/Tray test results, then an explicitly enabled native keyboard run for this head, including redacted output or captures.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-07T22:31:25.514Z sha bfcdc10 :: needs changes before merge. :: none

@RomneyDa
RomneyDa marked this pull request as ready for review October 7, 2026 22:41
@RomneyDa RomneyDa added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Oct 7, 2026
@RomneyDa
RomneyDa merged commit 037c17d into main Oct 7, 2026
53 of 59 checks passed
@RomneyDa
RomneyDa deleted the openclaw/pr-to-fix-the-issue branch October 7, 2026 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant