Skip to content

fix(agent): report uploaded image url in MCP image tool results - #1043

Merged
dingyi222666 merged 2 commits into
v1-devfrom
fix/mcp
Oct 2, 2026
Merged

dingyi222666 merged 2 commits into
v1-devfrom
fix/mcp

Conversation

@dingyi222666

@dingyi222666 dingyi222666 commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

MCP image tool results dropped the uploaded file info: after the binary was uploaded to ChatLuna storage, the converter returned only an image_url block, so the model never learned the file name or url — unlike resource blocks, which already report where the file landed.

Bug fixes

  • packages/extension-agent/src/mcp/content.ts: when standard content blocks are disabled, append a text block (The <name> has been uploaded. Url: <url>) next to the image_url block, and widen the return type to include MessageContentText. Image blocks are now consistent with resource blocks (Resource url: ...).

Other Changes

  • Bump koishi-plugin-chatluna-agent 1.0.45 -> 1.0.46 so the fix is publishable, and align the ^1.0.45 -> ^1.0.46 references in extension-tools and service-search (peer + dev dependencies).

Verification

  • yarn fast-build extension-agent and the full yarn build both pass (exit 0); yarn eslint packages/extension-agent/src/mcp/content.ts is clean.
  • No public API change.

When standard content blocks are disabled, MCP image tool results were
converted into a lone `image_url` block after the binary was uploaded to
the ChatLuna storage, so the model never learned the uploaded file name or
url.

Append a text block (`The <name> has been uploaded. Url: <url>`) next to
the `image_url` block and widen the return type accordingly, matching how
resource blocks already report their uploaded url (`Resource url: ...`).

Verified with `yarn fast-build extension-agent` (exit 0).
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: e1691d6b-6e08-4012-bdb8-3b913a46ef98

📥 Commits

Reviewing files that changed from the base of the PR and between 2f69f09 and edee82e.

📒 Files selected for processing (1)
  • packages/extension-agent/src/mcp/content.ts
 __________________________________
< RabbitMQ is just my side hustle. >
 ----------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

Bump koishi-plugin-chatluna-agent from 1.0.45 to 1.0.46 so the MCP image
result fix in this branch can be published to npm.

Update the dependent references from ^1.0.45 to ^1.0.46 in
koishi-plugin-chatluna-plugin-common (extension-tools) and
koishi-plugin-chatluna-search-service (service-search), both in
peerDependencies and devDependencies.
@dingyi222666
dingyi222666 merged commit bcd0c61 into v1-dev Oct 2, 2026
4 checks passed
@dingyi222666
dingyi222666 deleted the fix/mcp branch October 2, 2026 16:35
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