anomalyco / anomalyco/opencode
Core HTML conversion hangs when a code block exceeds the remaining budget
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
HTML-to-Markdown conversion hangs when prose fills the content budget and is followed by a fenced code block. An equal-size paragraph-only document completes. The input is below webfetch's 5 MiB response limit.
Plugins
Built-in webfetch converter; no external plugins.
OpenCode version
V2 source checkout at 541937d12449e64d078c67e9013f1c288004b83f.
Steps to reproduce
Run the production converter in a disposable child process with a watchdog:
const budget = 5 * 1024 * 1024 - 64 * 1024
const html = `<p>${"x".repeat(budget)}</p><pre>x</pre>`
WebFetchTool.convertHTMLToMarkdown(html)
Expected: conversion returns bounded Markdown. Actual: conversion stops making progress after the code payload becomes empty. The same-size paragraph-only control returns normally.
Operating System
macOS arm64, Bun 1.4.1.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the production WebFetchTool.convertHTMLToMarkdown entry point and reproduce the supplied paragraph-plus-fenced-code input with the watchdog, comparing it with the paragraph-only control. Trace the conversion after the code payload becomes empty; done means both inputs return bounded Markdown without stopping progress.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100