Summary
An agent-emitted HUMAN_QUESTION: marker gets posted to Slack with all whitespace stripped when the interactive CLI (e.g. claude) renders the marker line inside its TUI box:
Whichrate-limiterstrategyshouldweuse
The intended text was: "Which rate-limiter strategy should we use — token-bucket or fixed-window?"
Root cause
observeHumanAssistanceOutput in runner.js scrapes the question from the agent PTY output via extractHumanQuestionCandidates. When Claude's boxed TUI reflows the line, spaces are already gone before extraction (replace(/\s+/g, ' ') can't restore spaces that the terminal render dropped).
There is a mitigation — shouldPreferDeclaredHumanQuestion / humanQuestionLooksCompacted will prefer a declared question lifted from the task text — but extractDeclaredHumanQuestionFromTask only fires when the task literally contains the phrase:
/(?:followed by|with)\s+this\s+exact\s+question\s*:/i
If the workflow author writes a natural HUMAN_QUESTION: instruction without that exact marker phrase, declaredQuestion is undefined and the garbled PTY scrape is posted verbatim.
Impact
- The default/naive way to author an agent-driven Slack question produces garbled output.
- The fix (relayflows#16) is present in 1.0.4 but is effectively opt-in and undiscoverable — nothing warns the author that their question will be PTY-scraped unless they use the magic phrase.
Suggested fixes (any of)
- Make
humanQuestionLooksCompacted output route to a fallback that reconstructs the question from the raw marker in the agent's stdout/log (not PTY render) rather than posting the compacted string.
- When
renderedQuestion looks compacted and no declared question exists, hold and warn ([ask-human] question looks garbled; add "...this exact question:" to the task) instead of silently posting the mangled text.
- Document the
...this exact question: convention prominently in the writing-agent-relay-workflows skill's human-assistance section (it currently isn't mentioned).
Repro
Task that reproduces (no marker phrase):
Print exactly one line: HUMAN_QUESTION: Which rate-limiter strategy should we use — token-bucket or fixed-window?
Task that works (marker phrase):
Print one line beginning with HUMAN_QUESTION: followed by this exact question:
Which rate-limiter strategy should we use — token-bucket or fixed-window?
Environment
@relayflows/core 1.0.4, local relayflows run, claude interactive agent
- Previously reported/fixed at the platform level in relayflows#16; this is about the remaining opt-in gap.
Summary
An agent-emitted
HUMAN_QUESTION:marker gets posted to Slack with all whitespace stripped when the interactive CLI (e.g.claude) renders the marker line inside its TUI box:The intended text was: "Which rate-limiter strategy should we use — token-bucket or fixed-window?"
Root cause
observeHumanAssistanceOutputinrunner.jsscrapes the question from the agent PTY output viaextractHumanQuestionCandidates. When Claude's boxed TUI reflows the line, spaces are already gone before extraction (replace(/\s+/g, ' ')can't restore spaces that the terminal render dropped).There is a mitigation —
shouldPreferDeclaredHumanQuestion/humanQuestionLooksCompactedwill prefer a declared question lifted from the task text — butextractDeclaredHumanQuestionFromTaskonly fires when the task literally contains the phrase:If the workflow author writes a natural
HUMAN_QUESTION:instruction without that exact marker phrase,declaredQuestionisundefinedand the garbled PTY scrape is posted verbatim.Impact
Suggested fixes (any of)
humanQuestionLooksCompactedoutput route to a fallback that reconstructs the question from the raw marker in the agent's stdout/log (not PTY render) rather than posting the compacted string.renderedQuestionlooks compacted and no declared question exists, hold and warn ([ask-human] question looks garbled; add "...this exact question:" to the task) instead of silently posting the mangled text....this exact question:convention prominently in thewriting-agent-relay-workflowsskill's human-assistance section (it currently isn't mentioned).Repro
Task that reproduces (no marker phrase):
Task that works (marker phrase):
Environment
@relayflows/core1.0.4, localrelayflows run,claudeinteractive agent