Deliver worker outcome text instead of a placeholder result - #644
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
WalkthroughThe change preserves successful ChangesWorker outcome text flow
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The change delivers the worker’s full scrubbed outcome text instead of a placeholder. No actionable merge-blocking risk remains beyond normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
One-shot workers that finish via
set_status(kind: "outcome")had their final text discarded. The status text was only broadcast as an ephemeralWorkerStatusevent (capped at 256 chars), then the outcome-recorded termination path returned a hardcoded"Worker reported a terminal outcome."as the result. That placeholder became the durable terminal outcome and was exactly what the channel agent received on retrigger — so every outcome-signaled worker looked like it completed with nothing to say. Same story for the empty-result safety net, which substituted its own synthetic line.The fix carries the real text through:
set_statusnow scrubs the full text before the 256-char display cap (previously cap-then-scrub, so truncation could split a secret out of exact-match range) and, forkind: "outcome", includes the full scrubbed text in the tool output asoutcome.SpacebotHookretains that text when it detects the outcome signal, exposed viatake_outcome_text()and cleared with the rest of the per-prompt state.Worker::run()uses the retained text as the result in both completion paths, falling back to the last assistant message, then the old placeholder only when the signal carried no text.The task-level scrub in
spawn_worker_taskstill runs on the final outcome, so the delivered text passes through both scrubbing layers.Tests cover the full-text/capped-status split in the tool output, hook retention and take-consumes semantics, and reset clearing the retained text.
Note
Key Changes:
In
set_status.rs: Moved secret scrubbing before the 256-char cap to prevent secrets from being split during truncation. Addedoutcomefield toSetStatusOutputto carry the full uncapped text for outcome signals.In
spacebot.rs: Addedoutcome_textfield toSpacebotHookto retain the full outcome text. Implementedtake_outcome_text()method for consuming retained text and updatedreset_tool_nudge_state()to clear it. Added tests verifying full-text retention and reset behavior.In
worker.rs: Updated both outcome completion paths to usetake_outcome_text()with fallbacks to the last assistant message, then the original placeholder only when necessary.Written by Tembo for commit 43e8bbbd. This will update automatically on new commits.