Skip to content

fix(openclaw): split OpenViking import tools#1946

Merged
Mijamind719 merged 1 commit into
volcengine:mainfrom
Mijamind719:codex/openclaw-media-ov-import
May 10, 2026
Merged

fix(openclaw): split OpenViking import tools#1946
Mijamind719 merged 1 commit into
volcengine:mainfrom
Mijamind719:codex/openclaw-media-ov-import

Conversation

@Mijamind719
Copy link
Copy Markdown
Collaborator

@Mijamind719 Mijamind719 commented May 9, 2026

Summary

Fixes #1945.

Issue #1945 is the local OpenClaw chat media-attachment failure:

  • user attaches a document in chat, e.g. [media attached: /Users/.../.openclaw/media/inbound/xxx.xlsx (...)]
  • user asks “帮我把这篇文档保存到 openviking”
  • the model may fail to use the OpenViking import tool and instead invent unsupported endpoints such as /openviking/v1/files/upload
  • OpenViking returns 404, and the user sees a misleading upload failure even though local-file import should go through the plugin's temp-upload path

This PR fixes that flow by replacing the ambiguous agent-facing ov_import(kind=...) surface with two explicit OpenViking import operations:

  • add_resource / /add-resource: import a document, directory, URL, Git repository, or OpenClaw media attachment into OpenViking resources
  • add_skill / /add-skill: import or register an OpenViking agent skill

The add_resource tool now explicitly tells the agent to pass the exact local path from [media attached: /path ...] messages and not to invent OpenViking upload REST endpoints. The underlying behavior still uses the existing OpenViking upload/import APIs:

  1. POST /api/v1/resources/temp_upload for local files/directories
  2. POST /api/v1/resources for resource import
  3. POST /api/v1/skills for skill import

Docs, plugin manifest, command parsing tests, and the agent tool naming convergence note are updated accordingly. The old /ov-import slash command is no longer kept as a public command.

Testing

cd examples/openclaw-plugin
npm test -- --run tests/ut/tools.test.ts tests/ut/client.test.ts

Result: 2 test files passed, 75 tests passed.

Real OpenClaw chat E2E, 2026-05-10:

  • loaded this PR's OpenClaw plugin in OpenClaw 2026.5.7
  • verified OpenClaw Gateway commands.list exposes /add-resource and /add-skill
  • sent /add-resource /tmp/ov-pr1946-e2e/resource.md --to viking://resources/pr1946-mock-resource through chat.send; OpenClaw returned success and OV fs/stat + fs/ls found the imported resource file
  • sent /add-skill /tmp/ov-pr1946-e2e/demo-skill through chat.send; OpenClaw returned success and OV fs/ls viking://agent/main/skills found ov-pr1946-demo-skill
  • simulated the issue flow with natural language plus [media attached: /tmp/ov-pr1946-e2e/resource.md ...]; the model called add_resource with the exact local media path, the tool returned success, and OV fs/stat found viking://resources/pr1946-media-resource-2

Note: with the local real ov.conf, non-wait resource import persisted successfully, but --wait processing and skill import hit the current upstream model quota/connection limit. To avoid conflating plugin behavior with external quota, the full chat/tool/storage E2E above was rerun against a temporary local OpenAI-compatible mock model server while keeping the real OpenClaw plugin and OpenViking HTTP API path.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

1945 - Fully compliant

Compliant requirements:

  • Strengthened ov_import tool description
  • Added guidance to not invent upload endpoints
  • Added unit test for local media import
  • No changes to upload semantics or new APIs
⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 98
🧪 PR contains tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

@Mijamind719 Mijamind719 force-pushed the codex/openclaw-media-ov-import branch from 5446441 to e40c799 Compare May 10, 2026 04:58
@Mijamind719 Mijamind719 changed the title fix(openclaw): guide media attachments through ov_import fix(openclaw): split OpenViking import tools May 10, 2026
@Mijamind719 Mijamind719 force-pushed the codex/openclaw-media-ov-import branch from 5a99f14 to b66d51a Compare May 10, 2026 05:53
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

文件名或许可以改一下

Replace the ambiguous OpenClaw ov_import surface with explicit add_resource and add_skill tools and slash commands.

Guide media attachment imports through the existing OpenViking temp-upload and resource import APIs instead of invented upload endpoints.

Update docs, plugin manifest, and unit coverage for the split import commands.

Co-authored-by: GPT-5.5 <noreply@openai.com>
@Mijamind719 Mijamind719 force-pushed the codex/openclaw-media-ov-import branch from b66d51a to 9449d9b Compare May 10, 2026 06:09
@Mijamind719 Mijamind719 merged commit 0073ce7 into volcengine:main May 10, 2026
7 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

OpenClaw chat media attachments are not reliably imported via ov_import

2 participants