Skip to content

[AI-assisted] feat(android): add chat command controls#98796

Merged
Solvely-Colin merged 1 commit into
openclaw:mainfrom
IWhatsskill:android-chat-command-controls
Jul 3, 2026
Merged

[AI-assisted] feat(android): add chat command controls#98796
Solvely-Colin merged 1 commit into
openclaw:mainfrom
IWhatsskill:android-chat-command-controls

Conversation

@IWhatsskill

@IWhatsskill IWhatsskill commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

Android chat users need a visible New Chat control and a slash-command picker without Android becoming a second command-policy source.

The PR also addresses the review-blocking command-routing, generated-inventory, and command-picker cleanup follow-ups:

  • Android must preserve /new <model/text> command tails instead of locally consuming argument-bearing /new inputs.
  • The native i18n generated source inventory must stay in sync after merging current main.
  • Slash-command rows should not repeat the smaller command category label underneath each command description.

Why This Change Was Made

This keeps the Android UI controls while preserving Gateway-owned command and session semantics:

  • Gateway commands.list remains the source for slash-command suggestions.
  • Empty or failed command discovery does not fall back to an Android-local command catalog.
  • Slash selection fills command text in the composer instead of executing commands locally.
  • The header New Chat action and bare /new route use sessions.create with the selected parent session and emitCommandHooks=true.
  • Argument-bearing /new ... input stays on the normal Gateway chat command path.
  • Slash-command rows now show the command title and description without rendering command.category as a smaller secondary label under each row.
  • Native i18n inventory was refreshed from the current generated source set after the line-number changes.

This PR does not change provider/model routing, command execution semantics, permissions grants, dependencies, or lockfiles.

User Impact

Android users get first-class chat controls:

  • The chat header exposes a New Chat action.
  • The composer exposes slash-command suggestions from Gateway metadata.
  • /, /n, /mo, and alias prefixes such as /de filter by command name or alias.
  • Description/category text does not create unrelated slash matches.
  • Android no longer shows commands the connected Gateway did not advertise.
  • Bare /new can start a new chat locally, while /new <model/text> remains available to the Gateway command path.
  • Slash-command suggestions are cleaner because the smaller category caption is no longer repeated under each command description.
  • Command title, description, click behavior, routing, accessibility semantics, and /new argument preservation remain unchanged.
  • The branch no longer carries native i18n generated-inventory drift for this PR head refresh.

Evidence

Focused Android behavior and visual proof already attached to this PR:

  • ChatControllerCommandControlsTest covers Gateway command metadata parsing, unique New Chat labels, parent-linked sessions.create, and emitCommandHooks=true.
  • ChatCommandControlsTest covers slash prefix filtering and preserves /new gpt-5.5 continue by not routing argument-bearing /new locally.
  • Public Android emulator recordings show the header New Chat button, bare /new, /reset slash-command interaction, and slash-command filtering:

Header + creates a unique new chat session:

+.new.session.mp4

/new starts a new session:

commands.mp4

/reset slash-command interaction:

slash.new.mp4

Slash command filtering:

status.mp4

Latest local proof for the command category-label cleanup and native i18n inventory refresh:

git diff --check
PASS

pnpm native:i18n:check
native-app-i18n: entries=2366 changed=false
PASS

cd apps/android && ./gradlew --no-daemon :app:testPlayDebugUnitTest --tests ai.openclaw.app.ui.chat.ChatCommandControlsTest --console=plain --stacktrace
BUILD SUCCESSFUL in 3m 22s
PASS

Relevant source assertions for the latest cleanup:

ChatScreen.kt:
- SlashCommandRow no longer renders command.category as a smaller secondary label under each command description.
- The command title and description remain rendered.
- Click behavior and accessibility semantics remain on the row.

apps/.i18n/native-source.json:
- Generated inventory changed only because ChatScreen.kt line numbers shifted after removing the category-label block.

Relevant source assertions for the P1 command-tail repair:

ChatCommandControlsTest:
- shouldRouteInputToNewChat("/new") == true
- shouldRouteInputToNewChat("/new gpt-5.5 continue") == false
- resolveSheetComposerSendAction("/new gpt-5.5 continue", true) keeps send enabled

ChatControllerCommandControlsTest:
- parent-linked sessions.create payload contains "emitCommandHooks":true

What was not re-run in this final command category-label cleanup phase:

No new emulator recording was captured for the category-label removal; the latest change is a narrow row rendering cleanup backed by source diff, native i18n check, and the focused ChatCommandControlsTest.
ChatControllerCommandControlsTest was not re-run in this narrow pass because the latest patch does not touch controller session creation or Gateway routing.

@clawsweeper

clawsweeper Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 7:16 PM ET / 23:16 UTC.

Summary
The PR adds Android chat command controls: a header New Chat action, Gateway-backed slash-command suggestions, Android command/session plumbing, focused Android unit tests, and refreshed native i18n inventory.

PR surface: Other +1120. Total +1120 across 13 files.

Reproducibility: not applicable. as a feature PR. The review path is PR-head source inspection, Gateway protocol checks, proof media, and focused Android validation rather than a current-main bug reproduction.

Review metrics: 2 noteworthy metrics.

  • Android session-creating controls: 1 header action added. The new header action can create and switch chat sessions, so maintainers should notice the session-state behavior before merge.
  • Gateway command inventory consumer: 1 commands.list path added. Android becomes a new consumer of the Gateway command inventory contract, which matters for command metadata compatibility and proof.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster ✨ media proof bonus
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • Get explicit Android/session owner acceptance for the header New Chat path calling sessions.create.

Risk before merge

  • [P1] Merging this PR adds an Android UI path that can create and switch chat sessions through sessions.create; green CI proves the implementation path, but maintainers still need to accept that session-state ownership boundary.

Maintainer options:

  1. Accept Android-owned explicit session creation (recommended)
    A maintainer can approve the header New Chat path as the Android-owned UI affordance for sessions.create while keeping typed slash commands on Gateway chat.send.
  2. Move New Chat behind a Gateway-owned command flow
    If maintainers do not want Android to create sessions directly, revise the header action to use a Gateway-owned command/session seam instead of direct sessions.create.
  3. Pause the feature direction
    If Android should not add a session-control surface now, keep this PR paused rather than merging a second session-state initiation path.

Next step before merge

  • [P2] The remaining blocker is maintainer acceptance of the Android session-control boundary, not a narrow automated code repair.

Security
Cleared: The diff stays within Android app, test, and native i18n inventory files and does not add dependencies, lockfile changes, CI execution paths, secrets handling, or package-resolution changes.

Review details

Best possible solution:

Land the Gateway-backed slash picker and Android New Chat control only after the Android/session owner accepts the explicit sessions.create behavior for the header action.

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

Not applicable as a feature PR. The review path is PR-head source inspection, Gateway protocol checks, proof media, and focused Android validation rather than a current-main bug reproduction.

Is this the best way to solve the issue?

Conditionally yes: Gateway-backed commands.list plus normal chat.send slash routing is the right ownership shape, but the header New Chat sessions.create action is only the best final shape if maintainers accept Android as an explicit session-control surface.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority Android feature with focused blast radius but meaningful command-routing and session-state implications before merge.
  • merge-risk: 🚨 session-state: The PR adds an Android UI path that calls sessions.create and switches the active chat session.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (recording): The PR includes Android emulator recordings and an inspected slash-picker screenshot that directly show the changed UI behavior after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR includes Android emulator recordings and an inspected slash-picker screenshot that directly show the changed UI behavior after the fix.
  • proof: 🎥 video: Contributor real behavior proof includes video or recording evidence. The PR includes Android emulator recordings and an inspected slash-picker screenshot that directly show the changed UI behavior after the fix.
Evidence reviewed

PR surface:

Other +1120. Total +1120 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 13 1174 54 +1120
Total 13 1174 54 +1120

What I checked:

  • Repository policy applied: Root AGENTS.md and apps/android/AGENTS.md were read fully; root review policy makes session state, command ownership, and whole-decision-surface review relevant, while the Android scoped policy adds no release/license blocker for this diff. (AGENTS.md:1, c45124ab8554)
  • Current main does not already implement the feature: Current main has no Android chatCommands, refreshChatCommands, startNewChat, ChatCommandEntry, or commands.list symbols under the Android app, so the central PR behavior is not obsolete on main. (c45124ab8554)
  • Header New Chat creates session state: At PR head, ChatController.startNewChatAwait builds a sessions.create request, includes parentSessionKey and emitCommandHooks when a parent session is loaded, then switches the controller to the created session key. (apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt:151, 4112f43ccc6a)
  • Slash commands are Gateway-backed: At PR head, Android fetches commands.list with agentId, text scope, and includeArgs, and the UI filters only the returned command names and slash aliases rather than using a local command catalog. (apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt:501, 4112f43ccc6a)
  • Gateway protocol supports the consumed command contract: Current Gateway docs and schemas define commands.list, textAliases, includeArgs, acceptsArgs, and the sessions.create parentSessionKey/emitCommandHooks fields consumed by the Android PR. (packages/gateway-protocol/src/schema/commands.ts:83, c45124ab8554)
  • Regression tests cover the key routing boundary: The PR tests command discovery, parent-linked sessions.create, emitCommandHooks, duplicate/stale New Chat handling, and that typed /new is sent through chat.send without issuing sessions.create. (apps/android/app/src/test/java/ai/openclaw/app/chat/ChatControllerCommandControlsTest.kt:312, 4112f43ccc6a)

Likely related people:

  • obviyus: CONTRIBUTING.md lists @obviyus for the Android app, and local Android chat controller history includes Ayaan Zaidi commits in this area. (role: listed Android app owner and feature-history owner; confidence: high; commits: 34a5c47351d1, 3bda64f75c67, a41be2585fca; files: CONTRIBUTING.md, apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
  • ly85206559: Merged PR fix(android): filter device and internal sessions from thread picker #99557 touched ChatScreen.kt and native i18n inventory shortly before this review, adjacent to this PR's session picker and generated-inventory surface. (role: recent adjacent Android chat contributor; confidence: medium; commits: 73ae2175d2ca, f2045d05ae37, 8ccda32148c8; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt, apps/.i18n/native-source.json)
  • Solvely-Colin: Merged PR improve: refresh Android overview control surface #95557 touched ChatController.kt and ChatScreen.kt, and this account also posted the latest proof refresh for the current PR head. (role: recent adjacent Android contributor and proof refresher; confidence: medium; commits: c0370218179d, f815670cb11d, 4b0d82822f3d; files: apps/android/app/src/main/java/ai/openclaw/app/chat/ChatController.kt, apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
  • hannesrudolph: A repository member requested Mantis visual proof for the Android New Chat button and slash-command picker, making this account relevant for final user-visible behavior review. (role: reviewer/proof requester; confidence: medium; files: apps/android/app/src/main/java/ai/openclaw/app/ui/chat/ChatScreen.kt)
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.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Jul 1, 2026
@IWhatsskill
IWhatsskill marked this pull request as ready for review July 1, 2026 23:45
@hannesrudolph

hannesrudolph commented Jul 1, 2026

Copy link
Copy Markdown
Member

@openclaw-mantis visual task: verify the Android chat screen shows the new-chat button and slash-command picker, and selecting /new starts a fresh chat

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jul 1, 2026
@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 1, 2026
@clawsweeper clawsweeper Bot removed the P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. label Jul 2, 2026
@IWhatsskill
IWhatsskill marked this pull request as draft July 2, 2026 00:00
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jul 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jul 2, 2026
@IWhatsskill
IWhatsskill marked this pull request as ready for review July 2, 2026 06:11
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 2, 2026
@clawsweeper clawsweeper Bot added proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 2, 2026
@IWhatsskill

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jul 3, 2026
@Solvely-Colin

Solvely-Colin commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Maintainer proof refresh

Updated PR #98796 to 4112f43ccc6a51df0d8c293f586856bbf502aa07, rebased on current origin/main 6207a4e75baeb631ddefdcfabd1710781056e7d8.

P2 follow-up fixed:

  • ChatControllerTerminalAckTest now asserts the owned terminal-ack sequence (chat.send -> chat.history) while allowing the independent commands.list refresh triggered by health events.
  • Android no longer treats bare or selected /new as a local new-chat shortcut. Slash suggestions complete /new, and typed /new travels the normal Gateway chat.send command path.
  • Added controller proof that bare /new sends chat.send with "message":"/new" and does not issue sessions.create.
  • The explicit header New Chat button remains the Android UI action that calls sessions.create with the existing parent-session / command-hook behavior.
  • Regenerated apps/.i18n/native-source.json from the rebased source to clear the generated-inventory conflict path.

Focused proof on the rebased commit:

  • JAVA_HOME='/Applications/Android Studio.app/Contents/jbr/Contents/Home' ANDROID_HOME="$HOME/Library/Android/sdk" ANDROID_SDK_ROOT="$HOME/Library/Android/sdk" ./gradlew --no-daemon :app:testPlayDebugUnitTest --tests ai.openclaw.app.chat.ChatControllerTerminalAckTest --tests ai.openclaw.app.ui.chat.ChatCommandControlsTest --tests ai.openclaw.app.chat.ChatControllerCommandControlsTest --tests ai.openclaw.app.gateway.GatewaySessionInvokeTest -> pass
  • JAVA_HOME='/Applications/Android Studio.app/Contents/jbr/Contents/Home' ANDROID_HOME="$HOME/Library/Android/sdk" ANDROID_SDK_ROOT="$HOME/Library/Android/sdk" ./gradlew --no-daemon :app:testThirdPartyDebugUnitTest --tests ai.openclaw.app.chat.ChatControllerTerminalAckTest --tests ai.openclaw.app.ui.chat.ChatCommandControlsTest --tests ai.openclaw.app.chat.ChatControllerCommandControlsTest --tests ai.openclaw.app.gateway.GatewaySessionInvokeTest -> pass
  • node --import tsx scripts/native-app-i18n.ts check -> native-app-i18n: entries=2462 changed=false
  • git diff --check origin/main...HEAD -> pass
  • .agents/skills/autoreview/scripts/autoreview --mode local --prompt <scoped Android command-controls prompt> -> clean, no accepted/actionable findings

Live PR state after push: mergeable=MERGEABLE, mergeStateStatus=UNSTABLE while fresh CI is still running.

Screenshot proof retained from the emulator run:

slash command picker

Proof bundle: https://gist.github.com/Solvely-Colin/cd215ea7c334d2d6c9b638758042d104

@Solvely-Colin

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: android App: android merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 🎥 video Contributor real behavior proof includes video or recording evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

3 participants