Skip to content

Comments

Improve workspace experience in OpenClaw#180

Open
andyrewlee wants to merge 6 commits intomainfrom
projects-nested
Open

Improve workspace experience in OpenClaw#180
andyrewlee wants to merge 6 commits intomainfrom
projects-nested

Conversation

@andyrewlee
Copy link
Owner

@andyrewlee andyrewlee commented Feb 22, 2026

Summary

Describe the change and intended behavior.

Quality Checklist

  • Ran make devcheck locally.
  • Ran make lint-strict-new locally for changed code.
  • If UI/rendering changed, ran make harness-presets.
  • If tmux/e2e changed, ran go test ./internal/tmux ./internal/e2e.

Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

devin-ai-integration[bot]

This comment was marked as resolved.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 18 additional findings in Devin Review.

Open in Devin Review

strings.HasPrefix(clean, "─"),
strings.HasPrefix(clean, "────────────────"),
strings.HasPrefix(clean, "└ "),
strings.HasPrefix(clean, "> "),

Choose a reason for hiding this comment

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

🔴 shouldDropAgentChromeLine drops all lines starting with "> " which silently strips legitimate agent output

The new strings.HasPrefix(clean, "> ") check in shouldDropAgentChromeLine causes any line starting with "> " (greater-than + space) to be treated as chrome noise and silently dropped from agent output. This prefix is extremely common in legitimate content: Markdown blockquotes (> quoted text), shell prompt echoes (> cd /tmp), diff output context lines, and general agent prose that starts with >. The function is called from compactAgentOutput, detectNeedsInput, detectNeedsInputPrompt, trailingNeedsInputOptionLines, and lastNonEmptyLine — meaning it affects summaries, needs-input detection, delta computation, and the latest-line field in wait responses.

Root Cause and Impact

The intent was to filter droid TUI prompt lines like > Reply exactly READY in one line. (visible in the test at cmd_agent_output_signals_test.go:46). However, "> " is a standard Markdown blockquote prefix and appears in many contexts:

  • Agent output quoting user instructions: > The user asked to fix the login bug
  • Shell command echoes: > npm run build
  • Diff context lines: > +func newHelper()
  • Conversational quoting: > As mentioned earlier...

All such lines will be silently dropped from compactAgentOutput() results. Since shouldDropAgentChromeLine is used in lastNonEmptyLine (cmd_agent_output_signals.go:383), detectNeedsInput (cmd_agent_output_signals.go:189), and the wait-response builder (cmd_agent_wait_response.go:231), this causes:

  1. Summary/latest_line fields may be empty or skip important content when the most recent meaningful output starts with >.
  2. needs_input detection may miss prompts if the input hint line begins with >.
  3. Delta output loses blockquoted sections, making chat summaries incomplete.

Impact: Agent output is silently truncated for any assistant that uses Markdown blockquotes or shell echo lines, leading to incomplete summaries sent to chat orchestrators.

Prompt for agents
In internal/cli/cmd_agent_output_signals.go line 106, the check `strings.HasPrefix(clean, "> ")` is too broad. It should be narrowed to only match the specific droid TUI prompt pattern. Options:

1. Remove the `"> "` prefix check entirely and instead add a more specific pattern like checking for droid prompt echoes (e.g., lines that look like `> <user prompt text>` preceded by droid chrome).

2. Or, make the check more specific by requiring additional context, such as:
   - `strings.HasPrefix(clean, "> ") && len(clean) > 80` (only long prompt echoes)
   - Or keep it but only inside a droid-specific context flag

The safest fix is to remove line 106 (`strings.HasPrefix(clean, "> "),`) since the droid prompt line `> Reply exactly READY...` from the test would still be handled by the existing test's expected output (the test shows the `>` line IS dropped, but the actual READY output lines are preserved). The test at line 46 of cmd_agent_output_signals_test.go should be updated to verify the `> Reply...` line is NOT dropped (or the filter should use a narrower pattern).
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

1 participant