Repository navigation
Conversation
|
Reject conflicting known selectors before dispatch using their effective session-aware route identity. Preserve native fields when external references, cycles or pattern properties prevent proving that the child schema omits them. Add execution and SDK callback regressions for all three review findings, including equivalent qualified selectors and independent sibling dispatch. Refs 1jehuang#1811, 1jehuang#1822
There was a problem hiding this comment.
Thanks for the thorough implementation and validation. I refreshed this PR against master, independently reviewed it, and added a focused follow-up in e4b3e91 that preserves native fields allowed by explicit additionalProperties. The new SDK callback regression failed before the fix and passes afterward; your original commits are preserved.
Final local verification passed 44 batch tests, both schema-consumer tests, and 69 provider-matrix/e2e tests (7 existing ignores). A rebuilt isolated CLI also loaded the tracked optimization skill through direct, flat-batch, and nested-batch calls with matching contents, and rejected conflicting selectors. Remote verification was attempted but fell back locally because the remote machine could not create the isolated checkout path.
I approved and monitored current-head CI (38543181237). Its Windows cross-target job failed on unchanged jcode-companion/src/server.rs:209 (E0596), and Quality Guardrails failed on six unchanged jcode-base warning/Clippy findings. Other platform jobs are still running, but these completed failed jobs already prevent a green CI result. I am leaving the PR open rather than bypassing that merge gate. Code/test-size, panic, and swallowed-error gate outputs were identical on clean master and the integrated patch. No baselines or CI gates were relaxed.
Jcode agent (automated triage), on behalf of @1jehuang
Expose nested parameters in the batch schema and examples so wrapper selectors don't compete with native child fields. Preserve flat calls, recover unambiguous name-routed wrappers using effective tool schemas, and reject ambiguous routes before execution. Keep native arguments, args, input, and name fields intact. Bound schema inspection without resolving external references. Add regressions for duplicate MCP selectors, routing-field loss, nested dispatch, and compatibility cases.
Preserve a schema-declared native name even when its value names another registered tool. Add regressions for direct properties, schema combiners, and local references, plus execution-level checks for ambiguous selectors and session-local SDK schemas. Keep the new parameter description within the prompt budget and remove the production selector unwrap. Run the batch cohort and both registry schema checks explicitly in the Linux and macOS CI matrix. The existing no-run step compiled these tests without executing them. Refs 1jehuang#1811.
Add isolated local MCP endpoint tests for the original selector collision, canonical nested input, and native server/arguments preservation. Assert the raw tool and exact arguments received by the backend, with a cleared environment, bounded work, and disconnect after every outcome. The same tests fail on the unchanged master parser for both bug cases while the nested control passes. All three pass on the fix, and the existing batch CI selector runs them. Refs 1jehuang#1811.
Verify that flat skill_manage calls retain the child name and load the requested temporary project skill. Exercise the real SkillTool through batch dispatch, with an empty global registry and isolated project fixture. Refs 1jehuang#1811.
Reject conflicting known selectors before dispatch using their effective session-aware route identity. Preserve native fields when external references, cycles or pattern properties prevent proving that the child schema omits them. Add execution and SDK callback regressions for all three review findings, including equivalent qualified selectors and independent sibling dispatch. Refs 1jehuang#1811, 1jehuang#1822
Follow dependentSchemas when identifying native child fields so a conditional name declaration does not reject a valid flat batch or block its siblings. Keep local-reference resolution and the existing depth and work limits. Add an SDK callback regression, declaration and traversal-limit checks, and coverage for conditional arguments. Require locked dependencies in the batch CI commands, matching the surrounding test steps. Validation: 44 batch tests and both registry schema-consumer tests passed. Refs 1jehuang#1811.
aade491 to
1959013
Compare
|
One more shape that fails today and isn't in the new tests: the unified Observed on jcode v0.99.1 (7206efd), macOS arm64: // works
{"tool_calls":[{"tool":"mcp","action":"search","server":"example_server","query":"lookup","intent":"x"}]}
// fails: "missing field `action`" (the sibling fields are dropped once `arguments` is present)
{"tool_calls":[{"tool":"mcp","action":"search","server":"example_server","query":"lookup","arguments":{"x":1},"intent":"x"}]}
// fails the same way: the real-world case
{"tool_calls":[{"tool":"mcp","action":"call","server":"example_server","tool":"example_lookup","arguments":{"id":"abc123"},"intent":"x"}]}
// without `arguments` the error moves to the next field: "missing field `tool`"
{"tool_calls":[{"tool":"mcp","action":"call","server":"example_server","intent":"x"}]}The same {"tool_calls":[{"tool":"mcp","intent":"x","arguments":{"action":"call","server":"example_server","tool":"example_lookup","arguments":{"id":"abc123"}}}]}So two things collide here: |
Port the intent of 1jehuang#1822. Co-authored-by: Michael Katsevman <[email protected]>
Upstream-PR: 1jehuang#1357 Upstream-PR-Commit: 1jehuang#1357 0da5e81 Upstream-PR: 1jehuang#1362 Upstream-PR-Commit: 1jehuang#1362 5962058 Upstream-PR: 1jehuang#1486 Upstream-PR-Commit: 1jehuang#1486 fadc624 Upstream-PR: 1jehuang#1733 Upstream-PR-Commit: 1jehuang#1733 01f3415 Upstream-PR: 1jehuang#1750 Upstream-PR-Commit: 1jehuang#1750 1ac0c82 Upstream-PR: 1jehuang#1822 Upstream-PR-Commit: 1jehuang#1822 73f85fc Upstream-PR: 1jehuang#1912 Upstream-PR-Commit: 1jehuang#1912 36d7682 Upstream-PR: 1jehuang#1978 Upstream-PR-Commit: 1jehuang#1978 0f55643 Upstream-PR: 1jehuang#2007 Upstream-PR-Commit: 1jehuang#2007 638f87c Upstream-PR: 1jehuang#2213 Upstream-PR-Commit: 1jehuang#2213 c5e1487 Upstream-PR: 1jehuang#2234 Upstream-PR-Commit: 1jehuang#2234 0d4d5d4 Upstream-PR: 1jehuang#2266 Upstream-PR-Commit: 1jehuang#2266 217ddc2 Upstream-PR: 1jehuang#2267 Upstream-PR-Commit: 1jehuang#2267 e98c40b
Closes #1811 (batch MCP selector collisions).
Keep the batch selector separate from the complete child input under
parameters, and advertise that form in the schema and examples. Legacy flat calls use the effective child schema to preserve nativename,arguments,args, andinputfields. Unambiguousname: "mcp_call"wrappers retain the raw MCP tool, server, and arguments. Conflicting known routes are rejected before any child executes, while equivalent aliases still select one tool.This overlaps with #1817, but covers the intended behavior beyond removing a duplicate alias. I ran the same real child-dispatch checks against its
e69e269head and this branch. Its flat skill call losesname, and its legacy MCP call dispatches the raw tool instead ofmcp_call. Here, the real SkillTool loads the requested skill and the local MCP transport receives the exact raw tool and arguments. The canonical nested control still works. Regression tests and explicit CI selection are included.The follow-up fixes address the three findings from this PR's first Greptile review: ordinary conflicting selectors such as
read/edit, native names under unresolved external or cyclic schemas, and native argument envelopes declared throughpatternProperties. Route comparisons use the same session-aware identity as dispatch. Unknown schema traversal preserves child fields rather than guessing a different route. Each defect has a behavioral regression that failed before the fix and passes afterward, plus coverage for equivalentfunctions.read/readselectors.The remaining
dependentSchemasreview finding is fixed infb857368d. Conditional declarations now preserve native child fields, including local references, without removing the existing traversal limits. The SDK regression failed before the fix with the reported ambiguity error and passes afterward, including its independent sibling callback.Validation on October 20, 2026, after merging
masteratc607a88a9: all 44 batch tests and both registry schema-consumer tests passed through the CI timeout runner. Formatting, module resolution, locked metadata, and patch whitespace checks passed. The new batch CI commands also use--locked, matching the surrounding checks. The final base refresh preserves the upstream 200-character description limit with a 194-character nested MCP example.Earlier validation, before the October 20 base refresh
Previous validation on the earlier repaired sources: 39 batch tests and both schema consumer tests passed through the committed CI timeout runner. The registry cohort passed 59 tests with one existing ignore and three explicit unrelated exclusions (post-tool feedback hook and two token-cap tests). All 9 provider-matrix tests and 60 end-to-end tests passed, with the 7 existing end-to-end ignores retained. Changed-crate warnings-denied Clippy,
cargo check --all-targets --all-features, locked metadata, changed-file formatting, module resolution, test-size, dependency-boundary, and wildcard-re-export checks also passed.I also rebuilt the actual CLI and drove a real isolated daemon through its public debug commands. Flat batch loaded the tracked optimization skill, matching the direct control. Direct
mcp_call, the original legacy flat shape, and canonical nested batch all read the same real Cargo manifest through the official filesystem MCP server. The live tool catalog exposesparameters, and ordinaryread/editambiguity returns the documented error instead of dispatching. This used public repository files, not a mock MCP backend, customer systems, user credentials, or a model prompt.Current merge gate, October 20, 2026
The pushed head is
aade491b7, and GitHub reports it as conflict-free. Both the current-head CI run and linked-issue run areaction_required, with no jobs executed. The contributor account has read-only access to the upstream repository, so a maintainer must approve those workflow runs.The base refresh includes the upstream fixes for the original Windows listener error, missing Tokio test feature, and six
jcode-baselint errors. It does not make the PR ready to merge: master CI at5e7e0457cstill fails two Muse provider-matrix tests, Clippy, the warning budget, and the code-size, test-size, panic, and swallowed-error ratchets. The four structural checks also fail locally with the inherited diagnostics. No baselines or gates were relaxed. Merge still depends on those failures being repaired and the required checks passing on this PR head.