Skip to content

feat: support yahoo_finance search - #17022

Merged
yuzhichang merged 2 commits into
infiniflow:mainfrom
Haruko386:master
Jul 17, 2026
Merged

yuzhichang merged 2 commits into
infiniflow:mainfrom
Haruko386:master

Conversation

@Haruko386

@Haruko386 Haruko386 commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Summary

As title

image

@Haruko386 Haruko386 added 🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration labels Jul 17, 2026
@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. 💞 feature Feature request, pull request that fullfill a new feature. labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 85d5f170-e55a-4bab-bc78-1c7bb5741dca

📥 Commits

Reviewing files that changed from the base of the PR and between 592017b and 1067a6c.

📒 Files selected for processing (2)
  • internal/agent/tool/yahoo_finance.go
  • internal/agent/tool/yahoo_finance_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/agent/tool/yahoo_finance.go

📝 Walkthrough

Walkthrough

Yahoo Finance now supports multiple configurable report sections, search/chart/quoteSummary requests, crumb and cookie handling, recursive value formatting, and expanded integration and schema tests.

Changes

Yahoo Finance expansion

Layer / File(s) Summary
Tool contracts and invocation
internal/agent/tool/yahoo_finance.go, internal/agent/tool/registry.go
Yahoo Finance parameters, defaults, schemas, endpoint builders, invocation, and node-level boolean parsing now support multiple sections.
Upstream fetching and report rendering
internal/agent/tool/yahoo_finance.go
The tool conditionally fetches search, chart, and quoteSummary data, handles crumb/cookie propagation, and renders structured responses into markdown reports.
Validation and integration coverage
internal/agent/tool/yahoo_finance_test.go, internal/agent/component/tool_component_test.go
Tests cover endpoint flows, aliases, symbol resolution, rendering, errors, schemas, defaults, cookie propagation, and updated integration call counts.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant InvokableRun
  participant fetchYahooFinanceReport
  participant YahooFinanceEndpoints
  participant MarkdownRenderer
  InvokableRun->>fetchYahooFinanceReport: selected sections and stock code
  fetchYahooFinanceReport->>YahooFinanceEndpoints: request search, chart, and quoteSummary data
  YahooFinanceEndpoints-->>fetchYahooFinanceReport: decoded responses
  fetchYahooFinanceReport->>MarkdownRenderer: report sections
  MarkdownRenderer-->>InvokableRun: markdown report JSON
Loading

Possibly related PRs

Suggested labels: go

Suggested reviewers: hz-186

Poem

I’m a rabbit with stocks in my den,
Fetching charts and news again.
Crumbs and cookies guide the way,
Markdown blooms by close of day.
Hop, hop—AAPL reports are bright! 🐇

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 5.41% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive The description only says "As title" and lacks the brief summary and background context requested by the template. Replace "As title" with a short Summary that explains what changed and why it matters.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: adding Yahoo Finance search support.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@Haruko386
Haruko386 marked this pull request as draft July 17, 2026 02:56
@Haruko386
Haruko386 marked this pull request as ready for review July 17, 2026 02:56

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/agent/tool/yahoo_finance_test.go`:
- Around line 88-90: Replace t.Fatalf calls used inside HTTP handler goroutines
with t.Errorf so the request can complete safely. In
internal/agent/tool/yahoo_finance_test.go at lines 88-90, 154-156, and 262-264,
report the failure, return an HTTP error response, and exit the handler; at
lines 246-250, use t.Errorf for crumb/module mismatches. Apply the same
t.Errorf, HTTP error response, and handler exit pattern in
internal/agent/component/tool_component_test.go at lines 493-495.

In `@internal/agent/tool/yahoo_finance.go`:
- Around line 303-338: The fetchYahooFinanceReport flow should derive a
downstream symbol from the first search result’s quote symbol, falling back to
p.StockCode when no symbol is available. Use this resolved value for
fetchYahooFinanceChart and fetchYahooFinanceSummary instead of the original
input, and add a test covering company-name resolution.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 60d72253-b7a5-4f6d-83fd-9e375271665f

📥 Commits

Reviewing files that changed from the base of the PR and between 7c698f8 and 592017b.

📒 Files selected for processing (4)
  • internal/agent/component/tool_component_test.go
  • internal/agent/tool/registry.go
  • internal/agent/tool/yahoo_finance.go
  • internal/agent/tool/yahoo_finance_test.go

Comment thread internal/agent/tool/yahoo_finance.go Resolved
@Haruko386
Haruko386 marked this pull request as draft July 17, 2026 03:14
@Haruko386
Haruko386 marked this pull request as ready for review July 17, 2026 03:14
@Haruko386 Haruko386 added ci Continue Integration and removed ci Continue Integration labels Jul 17, 2026
@Haruko386
Haruko386 marked this pull request as draft July 17, 2026 03:15
@Haruko386
Haruko386 marked this pull request as ready for review July 17, 2026 03:15
@yuzhichang

Copy link
Copy Markdown
Member

LGTM

@yuzhichang
yuzhichang merged commit ddd7fc0 into infiniflow:main Jul 17, 2026
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 bug Something isn't working, pull request that fix bug. ci Continue Integration 💞 feature Feature request, pull request that fullfill a new feature. size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants