Repository navigation
fix(vcs): send the field names the API requires for create_link - #149
Merged
Merged
Conversation
vcs(action="create_link") posted source_type, source_id, target_type and
target_id. The API's create-link request is vcs_object_type, vcs_object_id,
cs_object_type and cs_object_id, all required, with both ids as UUIDs. The
route has had that shape since the VCS backend was added, so the API refused
every call from this tool; an agent reported "missing field vcs_object_type",
the first of four it reported only one of.
The tool's schema already documents source_* as the VCS object ("repo,
pull_request, issue, or commit") and target_* as the ContextStream object
("project, doc, plan, task, todo, decision, or node"), so the handler now sends
source_* as vcs_object_* and target_* as cs_object_*. No parameter or schema
changes. Both ids are parsed as UUIDs before the request, so a bad id is named
in the error and is not left to the API to reject.
Tests (new vcs_tests.rs, the first for this tool) drive create_link through
VcsTool against a local server that records the request: the exact body and
path the API receives, trimming, and an error naming each missing or non-UUID
field. They failed on the previous handler with the body
{source_id, source_type, target_id, target_type} and pass now.
The other vcs actions were not audited. This one had no tests, so a similar
mismatch elsewhere would not have been caught either.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: escott- <escott05@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vcs(action="create_link")has never worked against the API. It postssource_type,source_id,target_type,target_id; the API's create-link request isvcs_object_type,vcs_object_id,cs_object_type,cs_object_id, all required, with both ids as UUIDs. An agent reported "missing fieldvcs_object_type" (serde reports only the first of the four).The tool's schema already documents
source_*as the VCS object ("repo, pull_request, issue, or commit") andtarget_*as the ContextStream object ("project, doc, plan, task, todo, decision, or node"), so the handler now sendssource_*asvcs_object_*andtarget_*ascs_object_*. No parameter or schema changes. Both ids are parsed as UUIDs before the request, so a bad id is named in the error.The API contract was read from the private API's
CreateLinkRequestand handler; nothing in it constrains the type strings, so none are enumerated here.Tests
New
vcs_tests.rs, the first tests for this tool. They drivecreate_linkthroughVcsToolagainst a local server that records the request: the exact path and body the API receives, trimming, and an error naming each missing or non-UUID field. They fail on the previous handler (the body received was{source_id, source_type, target_id, target_type}) and pass now.Verification
On ovh-desktop, against
mainb5936a3 plus this change:cargo fmt --all --checkcargo clippy --locked --workspace --all-targets -- -D warningscargo test --locked --workspace --all-targets: 2958 passed, 0 failed (2955 before, plus the 3 new)account_connection_smoke.py: 9 testscargo audit --deny warningsandcargo deny --locked check: cleanOn a clean copy of the tracked files:
public_boundary.py,release_contract.py resolve-version, the release-contract, boundary, DCO, workflow, grounding and adoption script tests, andnpm test(6/6).Not verified: a real
create_linkagainst the live API with credentials (it writes a row; the request body is verified against the API's own request struct instead). The othervcsactions were not audited; this one had no tests, so a similar mismatch elsewhere would not have been caught either.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.