Fix worker completion results not reaching users#182
Merged
Conversation
- 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.
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What was happening
Two failure modes observed on worker completion retriggers:
skipthinking the[Worker completed]message was "already processed" — user gets nothingreplywith a 75-char teaser ("Here's the issues:") referencing the result as if the user can see it — user gets a stubRoot 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 replychannel.md.j2line 39 — tells LLM the[Worker completed]message is invisible to userschannel.md.j2rule 4 — always reply with brief ack after spawning a worker, only skip for branchesCode safety net (
channel.rshandle_agent_result):skipped && is_retriggerbranch: if LLM skips on retrigger but produced text output, sends it as fallbackAlso 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.