Repository navigation
Answer tokenized-market questions when AI synthesis fails - #283
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
The route now returns separate spot and perpetual prices and timestamps, but the primary generated-workspace path rebuilds market in parseIntelligenceResult using only the legacy lastPrice/providerTimestamp perpetual fields, and RegistryBlock therefore still renders the perpetual as the sole Bitget snapshot. The public replay serializer drops the new fields in the same way. Consequently, an rToken fallback viewed from Overview, the global companion, or a shared replay loses the returned tokenized-spot quote and may show the stock-perpetual price next to text claiming the token quote and freshness are shown separately; propagate and label both fields through these validated and published result shapes.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const now = Date.now(); | ||
| const assets = snapshots.map(snap => { | ||
| const assessment = assessments[snap.ticker] ?? sourceOnlyRead(snap); | ||
| const assessment = assessments[snap.ticker] ?? sourceOnlyRead(snap, tokenizedMarketQuestion); |
There was a problem hiding this comment.
Scope tokenized fallback intent to the referenced asset
When AI synthesis is unavailable, this newly passed request-wide flag can make ordinary stock questions produce an rToken answer: the existing matcher treats complete words such as recent, risk, and review as r plus 1–6 letters, so “What is the recent news for NVDA?” is now summarized as an rNVDA-market question. It also applies tokenized intent to every asset in a mixed request such as “Compare rNVDA with TSLA stock,” causing the TSLA fallback to discuss rTSLA. Determine tokenized intent from exact rToken symbols/keywords for each ticker before selecting the fallback.
Useful? React with 👍 / 👎.
| export function sourceOnlyAssessment(input: { ticker: string; headlineCount: number; publishers: number; latestTitle?: string | null; latestPublisher?: string | null; latestDate?: string | null; tokenizedMarketQuestion: boolean; spotSymbol?: string | null; spotPrice?: number | null; spotTimestamp?: number | null; perpSymbol?: string | null }): FlowAssessment { | ||
| const { ticker } = input; | ||
| const summary = input.tokenizedMarketQuestion | ||
| ? `${input.headlineCount} issuer-level ${ticker} headline${input.headlineCount === 1 ? " was" : "s were"} collected across ${input.publishers} publisher${input.publishers === 1 ? "" : "s"}${input.latestTitle ? `; latest listed item: “${input.latestTitle.slice(0, 120)}”${input.latestPublisher ? ` (${input.latestPublisher}${input.latestDate ? `, ${input.latestDate}` : ""})` : ""}` : ""}. This coverage concerns ${ticker}, not the r${ticker} token market. ${input.spotSymbol && input.spotPrice != null ? `A tokenized spot quote was returned for ${input.spotSymbol} at ${input.spotPrice}; quote freshness ${input.spotTimestamp ? "is shown separately below" : "is unverified"}.` : `No verified r${ticker} tokenized-spot quote was returned.`} ${input.perpSymbol ? `${input.perpSymbol} is a stock-perpetual reference, not the rToken.` : "No stock-perpetual reference was verified."} r${ticker}-specific liquidity, spread, and premium or discount were not measured. Conclusion: not enough evidence to judge whether r${ticker} is worth reviewing as a trading opportunity. A due-diligence review could proceed after verifying token availability, a fresh token quote, liquidity, spread, and premium or discount. AI synthesis is unavailable; no directional assessment was made.` |
There was a problem hiding this comment.
Bound the fallback summary before returning it
For an rToken fallback with a latest headline, this summary routinely exceeds 800 characters, and the unsliced publisher name can push it beyond the 900-character limit enforced by parseIntelligenceResult in lib/intelligence-ui.ts. In that case a successfully completed run started from the Overview or global companion is rejected as failing interface validation; owner-published replays also unconditionally slice the summary to 700 characters in app/api/research/replays/route.ts, typically cutting off the final AI-unavailable and no-directional-assessment disclaimer. Keep the generated fallback within the strictest downstream bound or preserve the complete structured conclusion through those consumers.
Useful? React with 👍 / 👎.
What changed
Verification