Skip to content

Conversation

@telnet2
Copy link
Owner

@telnet2 telnet2 commented Dec 8, 2025

Port the WebFetch tool from TypeScript to Go OpenCode. The tool fetches
content from URLs and returns it in the requested format (text, markdown,
or html).

Key features:

  • URL validation (must start with http:// or https://)
  • Configurable timeout (max 120 seconds, default 30)
  • Response size limit (5MB max)
  • HTML to Markdown conversion using html-to-markdown library
  • HTML to plain text extraction using goquery (strips scripts, styles)
  • Accept headers based on requested format
  • User-Agent spoofing to avoid blocking

Dependencies added:

  • github.com/JohannesKaufmann/html-to-markdown v1.6.0
  • github.com/PuerkitoBio/goquery v1.10.0

Port the WebFetch tool from TypeScript to Go OpenCode. The tool fetches
content from URLs and returns it in the requested format (text, markdown,
or html).

Key features:
- URL validation (must start with http:// or https://)
- Configurable timeout (max 120 seconds, default 30)
- Response size limit (5MB max)
- HTML to Markdown conversion using html-to-markdown library
- HTML to plain text extraction using goquery (strips scripts, styles)
- Accept headers based on requested format
- User-Agent spoofing to avoid blocking

Dependencies added:
- github.com/JohannesKaufmann/html-to-markdown v1.6.0
- github.com/PuerkitoBio/goquery v1.10.0
Move SubagentExecutor from internal/tool to internal/executor to break
the import cycle between tool and session packages.

The cycle was:
- tool/subagent_executor.go imported session
- session/processor.go imported tool

Now:
- tool package no longer imports session
- session package imports tool
- executor package imports both tool and session

This allows the tool package (including WebFetchTool) to build and test
properly.
Document the package structure, dependencies, and design principles
for go-opencode. Includes:

- ASCII dependency graph
- Package descriptions for all 18 internal packages
- Public API and command packages
- Dependency statistics and hub packages
- Key design principles
- External dependency list
@telnet2 telnet2 merged commit 9322e7b into main Dec 8, 2025
0 of 6 checks passed
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.

3 participants