Fix stay-scout-hub progress text never updating - #246
Open
Hotragn wants to merge 1 commit into
Open
Conversation
researchArea() in src/lib/api/area-search.ts handled two event types the research-area route never sent: route emits: CONNECTED, SCREENSHOT, COMPLETE, ERROR client reads: STATUS, COMPLETE, ERROR, and event.data.streamingUrl STATUS was the only source of currentAction, so the branch never ran and the progress line stayed empty for the whole run while the live preview and final analysis worked normally. The route consumes the agent stream but only forwarded STREAMING_URL and COMPLETE, dropping PROGRESS -- which is what carries the running narration. It now forwards PROGRESS as STATUS with the event's purpose, matching the vocabulary the client already expects. CONNECTED had the mirror problem: emitted with a "Starting research on X..." message that nothing read. The client now treats it like STATUS so that first message lands. Verified with tsc --noEmit, clean. Note npm run lint fails on main for this recipe -- eslint 9 with no eslint.config.js -- which predates this change and is untouched here. Found by the check in tinyfish-io#244; refs tinyfish-io#86.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
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.
Refs #86. Found by the conformance check in #244.
The bug
The research-area SSE relay disagrees with itself about event names:
STATUSis the only thing that setscurrentAction, soarea-search.ts:86never ran and the progress line stayed empty for the entire run. The live preview and the final analysis both worked, which is why this wasn't obvious — only the running narration was missing.CONNECTEDis the mirror problem: the route sends it with aStarting research on ${area.name}...message and nothing reads it, so that first message never appeared either.This came in with the SDK migration in #223. That PR correctly moved the route to
EventType.STREAMING_URL/event.streaming_url, but the client-side handler kept the older vocabulary and nothing checked the two still lined up.The fix
The route is the adapter between TinyFish's event vocabulary and this app's, so that's where the translation belongs.
It was consuming the agent stream but only forwarding
STREAMING_URLandCOMPLETE, droppingPROGRESS— which is the event that carries the running narration. Per the SDK's own types (@tiny-fish/sdk/dist/agent/types.d.ts:218-220),PROGRESShas apurpose: string. So:and the client now treats
CONNECTEDlikeSTATUS, since both carry amessagemeant for the same line.Two lines of behaviour, no new event names, no change to the live preview or the completion path.
Verification
Heads up, unrelated to this PR:
npm run lintfails for this recipe onmain— it'seslint .witheslint@^9but noeslint.config.js, so ESLint 9 can't find a config at all. I left it alone since it has nothing to do with this fix, but it means this recipe currently has no working lint. Happy to send a separate PR for that if useful.