Skip to content

Fix stay-scout-hub progress text never updating - #246

Open
Hotragn wants to merge 1 commit into
tinyfish-io:mainfrom
Hotragn:hotragn/fix-stay-scout-hub-progress
Open

Fix stay-scout-hub progress text never updating#246
Hotragn wants to merge 1 commit into
tinyfish-io:mainfrom
Hotragn:hotragn/fix-stay-scout-hub-progress

Conversation

@Hotragn

@Hotragn Hotragn commented Aug 4, 2026

Copy link
Copy Markdown

Refs #86. Found by the conformance check in #244.

The bug

The research-area SSE relay disagrees with itself about event names:

api/research-area/route.ts emits:   CONNECTED, SCREENSHOT, COMPLETE, ERROR
lib/api/area-search.ts reads:       STATUS, COMPLETE, ERROR
                                    + event.data.streamingUrl

STATUS is the only thing that sets currentAction, so area-search.ts:86 never 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.

CONNECTED is the mirror problem: the route sends it with a Starting 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_URL and COMPLETE, dropping PROGRESS — 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), PROGRESS has a purpose: string. So:

if (event.type === EventType.PROGRESS) {
  enqueue({ type: "STATUS", message: event.purpose });
}

and the client now treats CONNECTED like STATUS, since both carry a message meant for the same line.

Two lines of behaviour, no new event names, no change to the live preview or the completion path.

Verification

cd stay-scout-hub && npm ci
npx tsc --noEmit    # clean

Heads up, unrelated to this PR: npm run lint fails for this recipe on main — it's eslint . with eslint@^9 but no eslint.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.

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.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d7bc90b2-9d7e-4431-aa26-f7fc009253e9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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