Skip to content

Chat UI: strip thinking blocks from assistant text#109

Closed
ossianhempel wants to merge 3 commits intoopenclaw:mainfrom
ossianhempel:fix/strip-thinking-tags
Closed

Chat UI: strip thinking blocks from assistant text#109
ossianhempel wants to merge 3 commits intoopenclaw:mainfrom
ossianhempel:fix/strip-thinking-tags

Conversation

@ossianhempel
Copy link
Copy Markdown

Summary\n- strip … and wrappers from assistant history + streaming text\n- hide streaming bubble when only thinking content is present\n- add unit coverage for history + streaming sanitization\n\n## Testing\n- swift test (apps/shared/ClawdisKit)

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6b7bcf58d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 3, 2026

🦞 Codex Review

Findings

  • ⚠️ Medium: Sanitizer strips any literal <think>/<final> tags in assistant text, even inside code/examples; potential user-visible data loss for assistants that output XML/HTML or prompt templates. (ChatViewModel.swift:478)
  • ℹ️ Low: stripAssistantThinking trims leading/trailing whitespace on any tagged message; could alter formatting (e.g., intentional blank lines around replies).

Open Questions

  • OK to drop literal <think>/<final> in content? If not, need stricter heuristics (e.g., only strip when tags appear at start or outside code fences).

Summary
Adds sanitization for assistant history + streaming, removes <think> blocks and <final> tags; hides streaming text when only thinking remains. Includes tests.

Review by Clawd 🦞 via Codex

@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 4, 2026

Hi Ossian, please read https://github.com/steipete/clawdis/blob/main/CONTRIBUTING.md for contributing.
At least the PR message should be handcrafted or not contain \n :)

It's hard for me to understand the problem.

@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 4, 2026

I don't wanna hide this.

@steipete steipete closed this Jan 4, 2026
@steipete
Copy link
Copy Markdown
Contributor

steipete commented Jan 4, 2026

I don't wanna hide this.

dgarson referenced this pull request in dgarson/clawdbot Feb 7, 2026
…fail

Codex/gateway connect error fastfail
dgarson referenced this pull request in dgarson/clawdbot Feb 22, 2026
- UserJourneyMap: 3 journeys (New Agent/Debug/Deploy), step detail panels, completion metrics
- MemoryProfiler: process list, heap breakdown bars, timeline, flamegraph, GC events
dalefrieswthat pushed a commit to dalefrieswthat/openclaw that referenced this pull request Feb 25, 2026
)

Adds a default timeout for spawned sub-agents, configurable via
agents.defaults.subagents.timeoutSeconds in openclaw.json.

Previously, sub-agents with no explicit runTimeoutSeconds in the
sessions_spawn call defaulted to unlimited (0 = NO_TIMEOUT_MS in
resolveAgentTimeoutMs). This meant the global agents.defaults.timeoutSeconds
had no effect on sub-agents — only top-level sessions.

Changes:
- zod-schema.agent-defaults.ts: add timeoutSeconds to the subagents
  .strict() schema object so the field is accepted and validated
- types.agent-defaults.ts: add timeoutSeconds?: number to the
  AgentDefaultsConfig.subagents interface
- subagent-registry.ts (registerSubagentRun): fall back to
  cfg.agents.defaults.subagents.timeoutSeconds when no per-call
  runTimeoutSeconds is provided, before defaulting to 0 (unlimited)
- subagent-registry.ts (replaceSubagentRunAfterSteer): same fallback
  so resumed/steered sub-agents also respect the default

Explicit per-call runTimeoutSeconds=0 still means unlimited (no
behavior change for existing callers). If the config field is unset,
behavior is identical to before.
dalefrieswthat pushed a commit to dalefrieswthat/openclaw that referenced this pull request Feb 25, 2026
)

Adds a default timeout for spawned sub-agents, configurable via
agents.defaults.subagents.timeoutSeconds in openclaw.json.

Previously, sub-agents with no explicit runTimeoutSeconds in the
sessions_spawn call defaulted to unlimited (0 = NO_TIMEOUT_MS in
resolveAgentTimeoutMs). This meant the global agents.defaults.timeoutSeconds
had no effect on sub-agents — only top-level sessions.

Changes:
- zod-schema.agent-defaults.ts: add timeoutSeconds to the subagents
  .strict() schema object so the field is accepted and validated
- types.agent-defaults.ts: add timeoutSeconds?: number to the
  AgentDefaultsConfig.subagents interface
- subagent-registry.ts (registerSubagentRun): fall back to
  cfg.agents.defaults.subagents.timeoutSeconds when no per-call
  runTimeoutSeconds is provided, before defaulting to 0 (unlimited)
- subagent-registry.ts (replaceSubagentRunAfterSteer): same fallback
  so resumed/steered sub-agents also respect the default

Explicit per-call runTimeoutSeconds=0 still means unlimited (no
behavior change for existing callers). If the config field is unset,
behavior is identical to before.
heatherstew44-maker pushed a commit to heatherstew44-maker/openclaw that referenced this pull request Mar 8, 2026
Piboonsak added a commit to Piboonsak/openclaw_github that referenced this pull request Mar 9, 2026
- Add SSH key retry logic (3 attempts, 15s delay) to handle transient VPS unreachability (openclaw#110)
- Add SSH auth verification before proceeding with deploy
- Pin [email protected] to avoid npm install failures (openclaw#109)
- Add error handling for json5 install step
- Add config verification logging for safeBins and model persistence (openclaw#97, openclaw#100)

Fixes: openclaw#110, openclaw#109, openclaw#97, openclaw#100
Sprint: 1.6
github-actions bot pushed a commit to Piboonsak/openclaw_github that referenced this pull request Mar 10, 2026
CyberSpencer added a commit to CyberSpencer/openclaw that referenced this pull request Mar 19, 2026
…b_actions/actions/checkout-6

chore(deps): bump actions/checkout from 4 to 6
0x666c6f added a commit to 0x666c6f/openclaw that referenced this pull request Mar 26, 2026
…penclaw#109)

* fix(sessions:PLA-929): rotate transcript path on session id change

* fix: address PR review findings

* fix: address PR review findings

* fix: address PR review findings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants