Skip to content

fix(doubao): preserve image URLs in read output#708

Merged
jackwener merged 3 commits intojackwener:mainfrom
MonkeyLeeT:codex/fix-doubao-image-urls
Apr 3, 2026
Merged

fix(doubao): preserve image URLs in read output#708
jackwener merged 3 commits intojackwener:mainfrom
MonkeyLeeT:codex/fix-doubao-image-urls

Conversation

@MonkeyLeeT
Copy link
Copy Markdown
Contributor

Summary

  • preserve visible Doubao image URLs in browser read output
  • keep the existing Role/Text output shape by appending image lines as Image: <url>
  • refactor the page-side extraction into small helpers so the DOM scraping path stays readable

Root cause

The browser doubao extractor only collected visible text from message content. When Doubao returned an image response, the image DOM nodes were ignored, so doubao read dropped them entirely.

Impact

This makes image-bearing Doubao replies show up in the existing browser ask/read flow without introducing a new output model.

Validation

  • npx vitest run src/clis/doubao/utils.test.ts
  • npm run typecheck

Closes #675

@MonkeyLeeT MonkeyLeeT changed the title [codex] fix doubao image urls in read output fix doubao image urls in read output Apr 2, 2026
@MonkeyLeeT MonkeyLeeT marked this pull request as ready for review April 2, 2026 18:41
@MonkeyLeeT MonkeyLeeT changed the title fix doubao image urls in read output fix(doubao): preserve image URLs in read output Apr 2, 2026
Copy link
Copy Markdown
Owner

@jackwener jackwener left a comment

Choose a reason for hiding this comment

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

LGTM. Clean refactoring, image extraction logic is solid. Minor suggestion about aligning image selectors with text fallback selectors — not blocking.

Hardcoded image selector only covered the first two text selectors,
so images inside class-based message containers would be missed.
Generate from the shared selector list for consistency.
@jackwener
Copy link
Copy Markdown
Owner

Fixed the image selector inconsistency — now derived from messageTextSelectors instead of hardcoded. Pushed to origin/codex/fix-doubao-image-urls.

Since this is from a fork, I'll merge the fix via a separate commit on main if needed.

@jackwener jackwener merged commit f2a3ee6 into jackwener:main Apr 3, 2026
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.

[Bug]: 豆包返回的图片,无法提取

2 participants