Skip to content

Improve OpenClaw DX validation and summary sanitization#179

Merged
andyrewlee merged 2 commits intomainfrom
improve-openclaw
Feb 20, 2026
Merged

Improve OpenClaw DX validation and summary sanitization#179
andyrewlee merged 2 commits intomainfrom
improve-openclaw

Conversation

@andyrewlee
Copy link
Copy Markdown
Owner

@andyrewlee andyrewlee commented Feb 20, 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
Copy Markdown

@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 7 additional findings.

Open in Devin Review

@andyrewlee andyrewlee merged commit 8b987aa into main Feb 20, 2026
3 checks passed
@andyrewlee andyrewlee deleted the improve-openclaw branch February 20, 2026 10:39
Copy link
Copy Markdown

@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 11 additional findings in Devin Review.

Open in Devin Review

Comment on lines +390 to +400
if [[ -n "$fragment" && ( "$line" == "- "* || "$line" == "• "* ) ]]; then
line="$(trim_line "$line $fragment")"
if [[ "$line" == *":" ]]; then
if [[ -z "$candidate" ]]; then
candidate="$line"
fi
continue
fi
printf '%s' "$line"
return
fi
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Fragment variable not cleared after bullet combination causes stale fragment to leak to subsequent bullets

In extract_delta_summary_candidate, when a wrapped fragment is combined with a bullet line and the result ends with :, the fragment variable is never cleared. On subsequent iterations, the same stale fragment is incorrectly combined with earlier bullets (processed in reverse order), corrupting them into :‍-ending lines that get skipped instead of returned.

Root Cause and Impact

The combining block at skills/amux/scripts/openclaw-step.sh:390-400 combines $fragment with a bullet, but only clears the fragment implicitly via return (line 399). When the combined line ends with :, the function continues (line 396) without clearing fragment. On the next loop iteration, if the next line is also a bullet, the stale fragment is re-appended.

For example, given this reversed input:

wrapped_fragment): detail:
- Second bullet:
- Added file.md with description

With the bug: Step 3 combines - Added file.md with description with the stale fragment → - Added file.md with description wrapped_fragment): detail: which ends with : → skipped. The function falls back to a worse candidate.

Without the bug (fragment cleared): Step 3 processes - Added file.md with description on its own → contains .md, not file-only, doesn't end with : → printed as the summary.

Impact: Good summary bullets containing file references are silently skipped in favor of lower-quality fragment text whenever a preceding bullet+fragment combination ends with :.

Suggested change
if [[ -n "$fragment" && ( "$line" == "- "* || "$line" == ""* ) ]]; then
line="$(trim_line "$line $fragment")"
if [[ "$line" == *":" ]]; then
if [[ -z "$candidate" ]]; then
candidate="$line"
fi
continue
fi
printf '%s' "$line"
return
fi
if [[ -n "$fragment" && ( "$line" == "- "* || "$line" == ""* ) ]]; then
line="$(trim_line "$line $fragment")"
fragment=""
if [[ "$line" == *":" ]]; then
if [[ -z "$candidate" ]]; then
candidate="$line"
fi
continue
fi
printf '%s' "$line"
return
fi
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