Skip to content

Comments

Fix worker completion results not reaching users#182

Merged
jamiepine merged 5 commits intomainfrom
improve-worker-comms
Feb 23, 2026
Merged

Fix worker completion results not reaching users#182
jamiepine merged 5 commits intomainfrom
improve-worker-comms

Conversation

@jamiepine
Copy link
Member

@jamiepine jamiepine commented Feb 23, 2026

Summary

  • Fix retrigger prompt that let the LLM skip or send empty teasers instead of relaying worker results to the user
  • Add code-level fallback: if LLM skips on a retrigger turn but produced text, send it anyway
  • Change channel prompt to always acknowledge worker spawns (brief reply like "On it") instead of silently skipping

What was happening

Two failure modes observed on worker completion retriggers:

  1. LLM calls skip thinking the [Worker completed] message was "already processed" — user gets nothing
  2. LLM calls reply with a 75-char teaser ("Here's the issues:") referencing the result as if the user can see it — user gets a stub

Root cause: the retrigger prompt said "skip if the result doesn't add meaningful new information" and the channel prompt said "prefer skip and wait". The LLM treated [Worker completed] history entries as user-visible.

Changes

Prompt fixes:

  • retrigger.md.j2 — explicitly states user has NOT seen the result, must relay full substance via reply
  • channel.md.j2 line 39 — tells LLM the [Worker completed] message is invisible to users
  • channel.md.j2 rule 4 — always reply with brief ack after spawning a worker, only skip for branches

Code safety net (channel.rs handle_agent_result):

  • New skipped && is_retrigger branch: if LLM skips on retrigger but produced text output, sends it as fallback
  • Warns when LLM skips on retrigger with no text at all

Also includes workers tab design doc and minor UI fixes for worker display overflow.

Note

Automated Summary

This PR addresses a critical issue where worker completion results were not reaching users due to two LLM behavior problems on retrigger turns. The fix involves three layers: clarifying prompts to explicitly state that worker results must be relayed to users, updating channel communication rules to distinguish between worker acknowledgments (always reply) and branches (skip), and adding a code-level safety net that sends worker results as fallback text if the LLM incorrectly skips on retrigger turns. Additional changes include UI overflow fixes for worker displays and a comprehensive design doc for the workers tab feature that will track worker runs with event timelines and full transcripts.

Written by Tembo for commit 3e80351. This will update automatically on new commits.

- Introduced a new documentation file for the Workers Tab, detailing its concept, data model, and transcript lifecycle.
- Implemented an Active Workers Panel in the WebChat interface to display currently active workers and their statuses.
- Updated the WebChatPanel to include the Active Workers Panel and manage session IDs more effectively.
- Enhanced the ChannelDetail component to improve the display of worker run items and their statuses.
- Added a new utility function to generate portal chat session IDs for better session management.
- Updated prompts to clarify how worker results are communicated to users, ensuring they receive complete information from background processes.
@jamiepine jamiepine marked this pull request as ready for review February 23, 2026 23:15
…fecycle

- Revised the description of the Workers Tab to emphasize the full conversation transcript storage as a gzipped JSON blob.
- Updated the data model section to reflect changes in the `worker_runs` table and the addition of the `transcript` column.
- Clarified the JSON format for transcripts and the lifecycle of worker events, including live tracking and serialization processes.
- Removed references to the `worker_events` table as it is no longer part of the implementation.
@jamiepine jamiepine merged commit 2cf9b51 into main Feb 23, 2026
3 checks passed
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