Repository navigation
fix: keep composer predictions focused on the next user message - #441
Merged
Merged
Conversation
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.
Related: #437
What Problem This Solves
Resolves a problem where Web chat users could see prediction-model commentary as ghost text instead of a proposed next user message. Short history prefixes also omitted useful follow-up context.
Why This Change Was Made
Selectively aligns Composer with OpenClaw upstream
c4753809c7b151fdb40746c5ab534d5eb2caf1de: the exact prediction prompt, recent conversation serialized as task data in one fresh user message, a 160-token output budget, and a 500 UTF-16-unit display limit. The last eight visible user/assistant messages retain up to 2,000 Unicode code points each, preserving existing Unicode-safe slicing.The existing public SDK transport builder owns request shaping and receives the leaf API's
reasoning: "none"; explicit model compatibility metadata owns backend thinking fields. Its input types accept immutable model snapshots without cloning or dropping nested metadata. The existing reasoning-strip helper gains explicithidemode to discard closed or unfinished tagged reasoning, while ordinary reply recovery stays unchanged. Original reasoning is classified before final-marker cleanup. Server/account opt-out is rechecked immediately before egress after DNS and lazy transport loading.User Impact
Predictions receive more authorized recent context and use the common request/output paths. Model selection, Web/account/Space isolation, DNS-pinned private egress, redirect rejection, configured deadlines, immediate cancellation, and safe diagnostics remain intact. No dependency, config key, environment variable, database schema, protocol version, SDK subpath, or public SDK symbol is added.
Two existing input contracts expand: the reasoning helper's mode and immutable transport model inputs. Mutable model aliases and direct mutable compatibility-call returns remain supported; type-level overload introspection using
ReturnType/Parameterscan expose readonly views.Unmarked explanatory prose returned as final
contentcannot reliably be classified as reasoning by a consumer. Company Fast/LiteLLM output quality, latency, and GPU cancellation still need company-side live validation.Evidence
Validated on Linux against base
c7c25287febcc4e75ee021c4fae716467a0fcc9c, final 18-path patch SHA-256b50335979b2dd9ba1af34a22a45e0b29814ab0dc1f702272bf44bb87b8f85cde.gpt-6.1-sol/xhigh, P0 threshold, zero findings, exit 0. Used existing ChatGPT authentication with the app-bundled CLI; API-key variables were removed. No model fallback or TruffleHog. The isolated review copy matched all final source hashes.oxlint.extensions.jsonalso passed.Apistring union, mutable-call compatibility, and Responses. Unchanged siblings retain Linux evidence: 308 parser/reasoning tests, 197 AI/Completions/Responses/plugin cases, 771 UI tests, and 2,053 control-plane tests.Named follow-ups: shared bounded fire-and-forget completion delivery can leave admission busy when notification is dropped; managed transport and older provider metadata projection also differ. These belong to their shared lifecycle/transport owners and do not establish the company incident's cause.
AI-assisted implementation and description.