fix(responses): execute code-mode view_image through unified exec - #4455
fix(responses): execute code-mode view_image through unified exec#4455jeongjin0 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds ChangesCode-mode view_image compatibility
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant Provider
participant UndeclaredToolGuard
participant ExecCompiler
participant CodeModeTools
Provider->>UndeclaredToolGuard: Emit view_image or default.view_image
UndeclaredToolGuard->>ExecCompiler: Route through declared exec
ExecCompiler->>CodeModeTools: Call tools.view_image with path
CodeModeTools-->>ExecCompiler: Return image_url or host result
ExecCompiler-->>Provider: Emit image(image_url) or text(result)
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The requested view-image compatibility behavior is implemented with coverage for supported and rejected declaration paths. No actionable merge-blocking risk remains. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 7 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
2/4 boxes ticked. This PR stays in draft until every box above is ticked. |
|
@coderabbitai review |
✅ Action performedReview finished.
|
리뷰 · 우선순위 70 / 80설명 이 PR은 code-mode에서 모델이 변경은 네 겹입니다. (1) helper 목록에
경로 src/responses/code-mode-helper-compat.ts view_image 분기 - 경로 src/types/tools.ts default. helper strip - 경로 src/server/responses-undeclared-tool-guard.ts / core.ts - bare PR 본문 Verification - focused 120 pass는 설득력 있지만, 작성자가 기록한 무관 22실패 + draft 체크리스트 미완은 merge 전에 exact-head CI로 덮어써야 합니다. 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
b41c63f to
b09c5c2
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Restore routed view_image calls through the declared code-mode exec tool and surface the host image result while keeping undeclared and namespaced catalogs fail-closed. Co-authored-by: Rafael Moreira <rrmlima@gmail.com>
b09c5c2 to
61b9aef
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|
Lane R of the contributor carry train, the serialized responses/core lane: code-mode view_image through unified exec (#4455 by jeongjin0, also carrying the duplicate #4171 by rrmlima), routed effort ladders from models.dev with a refused-rung replay (#4409 by yxr1995-maker), and web-search continuations bound to the serving API key (#4387 by luvs01). Cross-platform CI run 34746891233 concluded success on 2c28886, the exact head merged here, and it covers every link because the lane is cumulative. #4475 and #4488 carry no ci check of their own; their head commits carry [skip ci] by design, under the owner-authorized tip-only CI economy for this batch. The fourth planned link, #4086 by Eleven-is-cool, is not here because it is already on dev as d6723f7 with its own Co-authored-by trailer. The lane attempted the carry first and found a modify/delete conflict on structure/04_transports-and-sidecars.md, which the #4276 SSOT restructure had removed; the landed version is a superset of the branch. All four source authors are credited by Co-authored-by trailers in the landed commits.
|
Closing as landed: executing code-mode view_image through unified exec is on dev via #4475, merged inside lane R's cumulative tip #4489 (merge commit 3f76ce4, verified as an ancestor of origin/dev). Your authorship is preserved by a Co-authored-by trailer in the landed commit itself rather than only in the pull request body, so it counts on your contributor graph. The carry folded the review findings already on this pull request. If you think something from this branch did not make it to dev, say so and I will reopen. |
…ip ci] A routed provider that echoes the nested helper name emitted `view_image` instead of the declared code-mode `exec`, and the undeclared-tool guard failed the turn. `view_image` now joins the helper names the guard admits behind a bare `exec` declaration, and the compiler turns the call into `await tools.view_image(...)`, surfacing the returned `image_url` through `image()` and falling back to `text()` when the host returns no image. The `default.view_image` spelling some providers invent is stripped to the bare helper first. Explicit `path` wins over the `file_path`, `file` and `image_path` aliases, in that order. Carries lidge-jun#4455 by jeongjin0 and the overlapping four-file subset in lidge-jun#4171 by rrmlima, both answering lidge-jun#4412. Folds in the review findings recorded on lidge-jun#4171: the compat path executes the helper rather than emitting a text-only stub, it asserts nothing about `view_image` being unavailable in code mode, and the composition cases the review named are covered end to end — a namespaced `view_image` keeps its full wire name, a flat-bridge catalog that declares `exec` beside a bare `exec_command` is never rewritten, and malformed arguments still reach nested validation as data. Co-authored-by: Jeongjin Shin <80797980+jeongjin0@users.noreply.github.com> Co-authored-by: rrmlima <137737127+rrmlima@users.noreply.github.com>
Summary
view_imageand syntheticdefault.view_imagecalls through the bare code-modeexectool, invokingtools.view_image(...)and surfacingimage(result.image_url)instead of terminating the turn.execfail-closed.Closes #4412
This supersedes #4171 with the supported nested helper behavior.
Co-authored-by: Rafael Moreira rrmlima@gmail.com
Verification
bun test tests/responses/legacy-shell-compat.test.ts tests/adapters/bridge-legacy-shell-normalization.test.ts tests/responses/responses-undeclared-tool-guard.test.ts(121 pass)bun run typecheckbun run structure:checkbun run privacy:scangit diff --check origin/dev...HEADChecklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.