Repository navigation
fix(ollama-native): retain tool batches across assistant commentary - #6519
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (8)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe Ollama adapter now defers assistant commentary while tool results remain outstanding. It emits accepted results in call order before deferred conversation, while retaining existing validation and missing-result handling. ChangesOllama tool-result replay
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant History as Parsed history
participant Replay as buildNativeMessages
participant Batch as PendingToolBatch
participant Output as Native messages
History->>Replay: Provide assistant calls and conversation
Replay->>Batch: Track unresolved call count
History->>Replay: Provide tool results and commentary
Replay->>Batch: Decrement unresolved count for each accepted result
Batch->>Output: Emit tool results in call order
Batch->>Output: Emit deferred conversation in arrival order
Merge Risk: ⚪ Minimal · up to The layout mappings remain intact, and no merge-blocking issue is established. The PR is mergeable after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to No confirmed security regression was found in the reviewed replay behavior. Tool-result validation remains enforced, and deferred commentary retains its original role. Remaining uncertainty concerns concurrent request isolation and changes outside that behavior. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. (4 skipped: 4 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Owner-authorized progressive maintainer integration into dev for the release stabilization train; an integration decision, not a self-approval. I reviewed the native Ollama replay change and its validation path. The unresolved counter decrements only after a result passes the existing ID/name/duplicate checks; assistant commentary is deferred only while results remain outstanding. New batches and EOF still settle missing results explicitly, and the original history is not mutated. Orphan, duplicate, reused-ID and namespace/name checks remain in place. Explicit scoped security review: no blocker; this neither executes tools nor introduces a credential destination. The separate independent review and 2,316 synthetic replay permutations are recorded in the lane evidence. Source #6509's author and all four carry commits are retained, with added adversarial regressions. Focused local tests, typecheck, structure/privacy, docs and bounded import-connected checks passed. The unrelated broad local run is not represented as passing and no live Ollama/physical tool execution claim is made. I also checked dev's #6513 exact-canonical-ChatGPT large HTTP upload conversion against this slice. Ollama destinations do not match it and the replay runtime paths do not overlap. I also verified the candidate's merged test-registry mappings against current dev: they are identical, with only redundant identical registrations removed. No test or cap was removed/raised. The conflict-free union is additional evidence, not a replacement claim for exact-current-head CI. Full integrated regression and cross-platform CI still precede publication. Hosted receipt: https://github.com/lidge-jun/opencodex/actions/runs/37131234397, attempt 1, pull_request, tested head |
Summary
Keep an unresolved native Ollama tool-call batch open when assistant text or thinking appears before its results. Emit genuine results in call order, then deferred conversation in arrival order. New tool-call batches and EOF retain explicit unknown-result settlement.
Carries all four commits from #6509 at
de5bb1f215c613670e03585e918a344c510ba97awith original authors and cherry-pick provenance. Adds ten adversarial tests for orphan/duplicate/name/namespace validation, reused/empty call IDs, cross-batch results, EOF, ordering and deep-frozen input. The source PR remains open. Also adopts the coordinator's JSON-equivalent shared registry normalization29a9e91f400d24ac746a18dfe3af357f5da6dec3, without its lane's auth runtime.Co-authored-by: potota90 85318310+adtumk@users.noreply.github.com
Verification
917fa4122977b7d890ba1115724e2b5a9a7940cd.bun scripts/test.ts --changed=dev tests/providers/ollama: 112 pass / 0 fail across 6 import-connected files.bun node_modules/typescript/bin/tsc --noEmit,bun scripts/structure-ssot.ts,bun scripts/privacy-scan.tsandgit diff --checkpassed. Direct checker entrypoints avoid the uninitialized local npm Bun shim after scripts-disabled frozen installation.cd docs-site && bun run build: passed, 561 pages / 77,932 internal links.Full local suite exception: concurrent stabilization worktrees share the workstation. The earlier unrestricted import-graph run expanded to 1,490 files and had unrelated, baseline-identical fixture/home-isolation failures; it is not claimed passing. This slice uses the focused and bounded import-graph commands above, with required hosted CI still mandatory. No live Ollama request, interactive Windows/packaged-desktop execution, or physical external-tool completion is claimed. Hosted Windows keyring/npm-global checks are separate CI evidence.
Checklist
Current-head CI receipt: Cross-platform CI 37131234397, attempt 1, event
pull_request, completed success for head917fa4122977b7d890ba1115724e2b5a9a7940cd. Checkout log confirms merge SHA374570e2b0775b6a1bdd25675fc67adfc1e402f1into deve77bfb4901d405724edc4295caf5d9f0675a672e(including Lane A). All 17 applicable workflow jobs succeeded, includingci, all four shards, gates, storage/API, Docker, keyring and npm-global Ubuntu/Windows, docs and structure. Eight scope-gated producers were skipped; full native platform/desktop coverage is not claimed. Other policy checks succeeded. No unresolved review threads or maintainer change requests were observed at readiness.Summary by CodeRabbit