fix: remove hardcoded disableBlockStreaming to honor agent config for TUI#19693
fix: remove hardcoded disableBlockStreaming to honor agent config for TUI#19693gumadeiras merged 6 commits intoopenclaw:mainfrom
Conversation
|
The webchat Note: this PR bundles 3 unrelated changes (timestamp removal, elevatedDefault fix, blockStreaming removal). VISION.md prefers one PR = one issue. Consider splitting:
The blockStreaming change alone is clean and mergeable 👍 |
|
This PR would fix #19643, which I filed. I can confirm that |
Additional Comments (1)
The fallback here was changed from
This means the status display (e.g. Prompt To Fix With AIThis is a comment left during a code review.
Path: src/auto-reply/reply/get-reply-directives.ts
Line: 352-356
Comment:
**Inconsistent `elevatedDefault` fallback across codebase**
The fallback here was changed from `"on"` to `"off"`, but other locations that resolve the same elevated default still fall back to `"on"`:
- `directive-handling.persist.ts:73`: `(elevatedAllowed ? ("on" as ElevatedLevel) : ("off" as ElevatedLevel))`
- `status.ts:391`: `args.agent?.elevatedDefault ?? "on"`
This means the status display (e.g. `/status`) will report elevated as `"on"` while the actual runtime behavior resolves to `"off"` when no explicit `elevatedDefault` is configured. If the intent is to change the default to `"off"`, these other locations should be updated as well to keep the behavior consistent.
How can I resolve this? If you propose a fix, please make it concise. |
32d64a4 to
90e5cbf
Compare
… TUI The chat.send handler was hardcoding disableBlockStreaming: true, which overrode the agents.defaults.blockStreamingDefault config setting. This caused TUI to ignore the blockStreamingDefault config and always stream token-by-token, overwriting previous content. Now the blockStreamingDefault config is respected for TUI/webchat just like other channels. Fixes openclaw#19643
d338b7b to
0e45297
Compare
… TUI (openclaw#19693) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 710d449 Co-authored-by: neipor <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
… TUI (openclaw#19693) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 710d449 Co-authored-by: neipor <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
… TUI (openclaw#19693) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 710d449 Co-authored-by: neipor <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
… TUI (openclaw#19693) Merged via /review-pr -> /prepare-pr -> /merge-pr. Prepared head SHA: 710d449 Co-authored-by: neipor <[email protected]> Co-authored-by: gumadeiras <[email protected]> Reviewed-by: @gumadeiras
Summary
The chat.send handler was hardcoding
disableBlockStreaming: true, which overrode theagents.defaults.blockStreamingDefaultconfig setting. This caused TUI to ignore the blockStreamingDefault config and always stream token-by-token, overwriting previous content.Root Cause
In
src/gateway/server-methods/chat.tsat line 901, the webchat dispatch was setting:This hardcoded value prevented users from using
blockStreamingDefault: onto get complete response blocks in TUI, unlike Telegram which respects this config.Fix
Remove the hardcoded
disableBlockStreaming: trueso that the agent configurationagents.defaults.blockStreamingDefaultis respected for TUI/webchat just like other channels.Now users can set
blockStreamingDefault: onin their config to get complete response blocks instead of streaming token-by-token.Fixes
Greptile Summary
This PR makes three distinct changes:
Removes hardcoded
disableBlockStreaming: truefrom the TUI/webchat chat handler (chat.ts), allowing theblockStreamingDefaultagent config to take effect for webchat — consistent with how other channels (e.g., Telegram) already behave.Removes dynamic timestamp generation from system prompt params (
system-prompt-params.ts), removing imports offormatUserTime/resolveUserTimeFormatand no longer returninguserTime/userTimeFormat. This is done intentionally to avoid breaking Anthropic prompt caching. TheSystemPromptRuntimeParamstype still declares these as optional, and all callers gracefully handleundefined, so this is safe. Agents can usesession_statusto get the current time instead.Changes the
elevatedDefaultfallback from"on"to"off"inget-reply-directives.ts. This is a behavioral change that means elevated mode will default to off when no explicit config is set.elevatedDefaultfallback change introduces an inconsistency:directive-handling.persist.ts:73andstatus.ts:391still fall back to"on", which may cause the status display to report a different elevated level than what is actually applied at runtime.Confidence Score: 3/5
disableBlockStreamingfix is straightforward and safe, but theelevatedDefaultfallback change introduces inconsistency with other code paths.disableBlockStreaming: true) and the prompt caching improvement (removinguserTime) are clean and correct. However, changing theelevatedDefaultfallback from "on" to "off" in only one of three locations that resolve this value creates a behavioral inconsistency where status reporting and change-detection logic disagree with the actual runtime behavior.src/auto-reply/reply/get-reply-directives.ts— theelevatedDefaultfallback change has inconsistencies withsrc/auto-reply/reply/directive-handling.persist.tsandsrc/auto-reply/status.ts.Last reviewed commit: 32d64a4
(5/5) You can turn off certain types of comments like style here!