[codex] Fix TinyFish monitor and search region ingestion#6
Open
Tien-Cheng wants to merge 10 commits into
Open
Conversation
…-region # Conflicts: # app/investigation/[id]/components/ChatPanel.tsx # app/investigation/[id]/page.tsx # convex/functions/investigations.ts # convex/tools/searchMarketplace.ts
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.
What changed
This PR implements the
searchRegioningestion path end to end and fixes the TinyFish monitor so live agent activity shows up on the investigation page while TinyFish is running.It also extracts the marketplace search parsing flow into a shared helper so the backend action and the existing search tool use the same TinyFish normalization, error handling, and extractor fallback path.
Why it changed
The investigation workflow was launching TinyFish runs, but the core B-2 action still needed to create findings, score risk, and update monitor state through the Convex pipeline.
On the frontend, the monitor query was treating TinyFish screenshot URLs like Convex storage IDs, which could break the query and leave the UI stuck in its empty state even while the TinyFish agent was actively running.
User and developer impact
Users now get live TinyFish monitor cards and activity log updates during marketplace sweeps, plus findings written from
searchRegionwith price deviation, risk score, risk level, and risk signals populated for downstream clustering and case generation.Developers now have a shared marketplace search helper, a dedicated mini-model risk assessor, and idempotent monitor initialization for workflow retries.
Root cause
The monitor data path was failing at query time because external TinyFish screenshot URLs were passed into
ctx.storage.getUrl(...), which expects a Convex storage ID.Separately,
searchRegionwas still a stub, so the workflow could launch searches without producing the findings and monitor updates that the rest of the pipeline expects.Validation
pnpm exec eslint convex/functions/investigations.ts convex/functions/monitor.ts convex/tools/searchMarketplace.ts convex/lib/marketplaceSearch.ts convex/agents/riskAssessor.ts convex/workflows/investigate.ts shared/schemas.tspnpm exec eslint convex/functions/monitor.ts 'app/investigation/[id]/components/TinyFishMonitor.tsx' 'app/investigation/[id]/components/ActivityLog.tsx'pnpm exec tsc --noEmitNotes
This PR is opened as draft because the remaining validation is runtime verification against a live TinyFish session from the investigation UI.