Repository navigation
feat: suggest the next prompt in PlatformClaw web chat - #413
Merged
Merged
Conversation
iililiiilili
marked this pull request as ready for review
October 27, 2026 23:40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #412
What Problem This Solves
PlatformClaw Web users currently write every follow-up from an empty composer. This adds an optional suggested next question after a browser-submitted response completes, without sending a message or approving an action for the user.
Why This Change Was Made
Selectively adapt the upstream prediction lifecycle to the Lit composer. The existing admin HTTP plugin owns the isolated Fast request and SQLite account preference; the authenticated BFF owns identity, authorized personal/Space history, and cancellation; the composer owns presentation and keyboard/IME behavior. No prediction operation is exposed as an agent tool or Gateway WebSocket method.
Inference uses only the configured
codemate/codellm-fastroute, six recent user/assistant text messages capped at 300 Unicode characters each, and 64 output tokens. It has a ten-second whole-request deadline, one active request per Gateway process, no queue/retry/fallback, and ordinary model calls preempt speculative work. Private DNS destinations are pinned and redirects forbidden. Predictions are neither broadcast nor saved in chat history.Existing menu keyboard handling and WebSocket response helpers are extracted unchanged to keep their owning modules bounded. No dependency, protocol-version, or SQLite schema-version change is included.
User Impact
Enable the server's
plugins.entries.admin-http-rpc.config.composerPredictionsEnabledflag, then opt in under Settings > Appearance > Chat preferences. Both defaults are OFF; the account preference persists in the existing plugin SQLite keyed store.Ghost Text stays separate from the draft. Tab inserts it without sending; Escape, typing, Korean IME composition, session changes, and a new response discard it. Enter keeps its existing behavior. Browser dispatch provenance prevents Knox, Cron, background, and API completions from triggering predictions, including unrelated completions in the visible session.
The standalone development-only preview works in a fresh browser tab and survives closing the browser. In a normal checkout, run
pnpm platformclaw:composer-preview(linked-worktree instructions are documented); its banner distinguishes synthetic results from real LLM calls and offers success, delay, timeout, and busy scenarios.Evidence
89dc123a5f98c8ea2f3b0a4a2c763eb411f038d4is green in CI run 40616633913 and PlatformClaw CI run 40616633914. All 79 reported checks are complete with no failures or pending checks; non-applicable checks are skipped. The PR remains Ready and mergeable.patch is correct; default P0 threshold, Codexgpt-5.6-sol, high). TruffleHog scanned each exact change successfully. The local helper copy uses its existing Windows URI normalizer and one scanner worker; scan/finding scope and isolation are preserved. Codex isolation flags were personally checked in siblingcodex-rs/exec/src/cli.rs:36-45.e6dd20821eff090f37c1c6cae0569b9b23263c44, matched byte-for-byte across the worktree, review snapshots, and Linux proof. Final aggregate SHA256:4f26c3f260194ff3c5f6b10d00885d6702aa486df74b379092228a8288a37d02.git diff --checkpassed.Validation limits and follow-ups
Initial local full-gate/type-lint attempts hit SDK preparation timeout or the fixed memory/swap budget; these attempts are retained as failures, not counted as passes. Final hosted full gates passed. A bounded task-only typed-lint mirror was used for the before/after diagnostic; it did not replace hosted validation. Optional video setup with an intentionally empty browser cache lacked ffmpeg; screenshots and later normal-cache Canvas recordings were preserved.
No company Fast endpoint/credentials are available here. Model availability/quality, measured GPU cancellation, and normal-chat latency under live load remain unverified. HTTP cancellation is propagated; stopping GPU work depends on the serving stack. Before enabling multiple Gateway instances, add a shared admission owner; the current limit is process-local.
Named follow-up: the Memory source-preview fixture seeds appearance records without explicitly selecting a Gateway. A standalone Vite observation showed saved dark preferences falling back to light; using the existing page-scoped selection restored dark. Product theme policy and Memory assertions remain unchanged; final hosted Memory tests passed. Independently triage existing default-branch dependency alerts; this PR changes no dependency version.
Review measurements
AI-assisted with Codex. No session transcript, credentials, internal endpoint, runtime database, or execution log is included in the branch.