Repository navigation
feat: add image inspector plugin - #2286
henryZhouLikeStudy wants to merge 4 commits into
Conversation
d3099f8 to
ca5b8b6
Compare
|
CI run https://github.com/TencentCloud/Octop/actions/runs/39939099843 is currently |
|
Thanks for the image inspector tool — we integrated it into a self-hosted deployment and hit a path-resolution bug that is worth fixing upstream. Symptom
Environment Octop 1.0.2, self-hosted; agent backend is the docker sandbox; the data directory is a mounted volume instead of Root cause
Suggested fix
Tests Two unit tests added to Happy to open a PR with the implementation if you would like to take it. |
|
@xlwreally Thanks for the detailed reproduction. The path-resolution issue is confirmed and fixed in The resolver now:
Added regression coverage for custom Validation:
GitHub Actions is still |
|
@xlwreally The reported path-resolution scenario has now been validated in a self-hosted production Octop environment. Deployment:
Online path test:
Note: one ordinary CLI Agent round incorrectly selected This record contains no user image, chat content, account ID, server address, API key, or token. GitHub Actions remains |
d9f671c to
a5bbb3c
Compare
# Conflicts: # CHANGELOG.md # Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
a5bbb3c to
00f1d5b
Compare
|
Rebased onto current develop and resolved the changelog conflict while preserving both branches' entries. New head: 00f1d5b. Image-inspector/plugin/layout tests: 34 passed; Ruff and diff checks pass; CodeCC check passes. |
Summary
Adds an independent
image-inspectortool plugin for visual review of images generated in an Octop workspace.The tool is manually invoked with the
localPathreturned bygenerate_image. It validates that the image is inside an Octop workspace, reads a supported raster image, and makes one dedicated multimodal model request with a Base64image_urlblock. The returned review covers clipping, overlap, alignment, spacing, contrast, hierarchy, and other visible defects.Why the model request is inside the tool
Returning an image block from the tool result is insufficient in the current runtime: Octop serializes that media block to a text representation before the next model call. Browser screenshots are also represented as path-preview blocks in persisted history.
To ensure the image actually reaches the model,
inspect_imageinvokes the Agent's resolvedautomodel directly with the image as a data URL. The outer Agent then receives a text-only visual assessment and can continue its normal workflow.Parent-stream isolation
The nested visual-review request must not inherit the parent LangGraph callbacks. Without isolation, its generated tokens are projected as normal assistant output and can be sent to an IM channel or persisted as an extra assistant message.
The dedicated request now:
lc_source=image_inspector;inspect_imagetool result.A regression test installs a parent chat-model callback before invoking the tool and verifies that the callback receives zero starts from the nested review request.
Workspace compatibility and safety
OCTOP_HOME,OCTOP_DATA_DIR, and the default~/.octop.agents/orworkspaces/..harness-materialize/for Docker sandbox files.Validation
develop; PR head:d9f671cc754bed81e33de55e6154ff9fe9ae8bb3.uv run --frozen pytest tests/unit/test_image_inspector_plugin.py tests/unit/test_plugins.py tests/unit/test_bundled_plugins_layout.py -q32 passeduv run --frozen ruff check src testsuv run --frozen ruff format --check src tests1294 files already formatteduv run --frozen mypy src/octopSuccess: no issues found in 627 source filesuv run --frozen pytest -n auto -m "not live"on Windows:5113 passed, 225 skipped; 34 environment-only failures remain in unchanged database-migration GBK and Bash/WSL-dependent Docker/vendor tests. None involveimage-inspectoror its changed files..harness-materializefallback, and real multimodal inspection of a synthetic image with intentional clipping.GitHub Actions requires maintainer approval for this fork PR; no CI jobs have run for the rebased head yet.
Checklist
Closes #2283