Skip to content

feat(opencode): add iFlow provider for web tools#31515

Open
zhengyanglsun wants to merge 1 commit into
anomalyco:devfrom
zhengyanglsun:feat/iflow-web-tools
Open

feat(opencode): add iFlow provider for web tools#31515
zhengyanglsun wants to merge 1 commit into
anomalyco:devfrom
zhengyanglsun:feat/iflow-web-tools

Conversation

@zhengyanglsun

@zhengyanglsun zhengyanglsun commented Jun 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds an opt-in iFlow provider path for OpenCode's existing websearch and webfetch tools.

When explicitly configured, websearch calls iFlow POST /api/search/webSearch and webfetch calls iFlow POST /api/search/webFetch:

OPENCODE_WEBSEARCH_PROVIDER=iflow
OPENCODE_WEBFETCH_PROVIDER=iflow
IFLOW_API_KEY=...

The current default behavior is unchanged. Setting only IFLOW_API_KEY does not change the selected provider. OPENCODE_ENABLE_IFLOW=true is supported only for tool availability checks.

The implementation also normalizes iFlow search/fetch responses into model-friendly text and keeps API keys and Authorization headers out of tool output and metadata.

How did you verify your code works?

Ran the focused tool tests:

bun test --timeout 30000 test/tool/iflow-search.test.ts test/tool/iflow-fetch.test.ts test/tool/websearch.test.ts test/tool/webfetch.test.ts

Result: 40 pass, 0 fail.

Ran typecheck:

bun run typecheck

Result: passed.

Also manually smoke-tested webSearch and webFetch against iFlow using a local IFLOW_API_KEY. No API key or Authorization header is included in this PR.

Screenshots / recordings

Not applicable; this is not a UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Hey! Your PR title Add iFlow provider support for websearch and webfetch doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@zhengyanglsun zhengyanglsun changed the title Add iFlow provider support for websearch and webfetch feat(opencode): add iFlow provider for web tools Jun 9, 2026
@github-actions github-actions Bot removed needs:compliance This means the issue will auto-close after 2 hours. needs:title labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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