Repository navigation
feat(tools): support reading both comparison sides - #1903
Merged
Merged
Conversation
Contributor
|
🔍 OpenCodeReview found 1 issue(s) in this PR.
|
| } | ||
| updatedProperties = append(updatedProperties, []byte(`"side":{"type":"string","enum":["new","old"],"description":"The side of the current comparison to access. Defaults to new. Paths and line numbers belong to the selected side."}}`)...) | ||
| parameters["properties"] = updatedProperties | ||
| fields["parameters"], _ = json.Marshal(parameters) |
Contributor
There was a problem hiding this comment.
The error from json.Marshal(parameters) is silently discarded. While marshaling a map[string]json.RawMessage is very unlikely to fail, if it does, fields["parameters"] becomes nil, and the function proceeds to return a FunctionDef with a null parameters field and no error indication. This would produce a malformed tool definition sent to the LLM.
Consider propagating the error:
var err error
fields["parameters"], err = json.Marshal(parameters)
if err != nil {
return llm.FunctionDef{}, fmt.Errorf("marshal updated parameters: %w", err)
}
lizhengfeng101
force-pushed
the
feat/code-tools-comparison-sides
branch
from
November 11, 2026 07:24
45af48f to
59d35ce
Compare
lizhengfeng101
force-pushed
the
feat/code-tools-comparison-sides
branch
from
November 11, 2026 11:46
6094c87 to
063c70f
Compare
This was referenced Nov 12, 2026
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.
Description
Add deterministic before/after code access as a foundation for Behavior and Impact analysis, without adding a new agent or changing the scan tool protocol.
side: "new" | "old"onfile_read,code_search, andfile_findfor commit and range reviews. Omitting it preserves existing new-side behavior and output.sidein current-only execution, and derive comparison schemas without mutating the base tool catalog.current-only/v1orcomparison-sides/v1in session execution metadata. Resumed sessions retain their profile; legacy sessions remain current-only and unknown profiles fail explicitly.git show.Older binaries do not enforce the new profile field. Use a compatible version to resume a comparison-side session.
Type of Change
How Has This Been Tested?
make testpasses locallyManual testing (describe below)
make check: passed.make test: passed, including race detection.make coverage: passed, 91.6% overall coverage (90% required).git diff --cached --check: passed; staged files use LF line endings.Required OCR review: complete for all 15 selected production source files, with no critical/high/medium findings after the shallow-boundary fix. One low-priority error-message suggestion remains. Tests and documentation were inspected separately.
Regression coverage includes default-output compatibility, unchanged scan/workspace tool definitions, renamed/deleted files, empty and missing trees, concurrent side access, frozen refs, raw/parsed schema consistency, and session profiles. A fake-model HTTP integration test exercises all three old-side tools through the CLI and reloads the persisted session profile.
The shallow-boundary regression fails before the fix and covers success after unshallowing. Automated checks run with project-local
TMPDIR/GOTMPDIRandGIT_CEILING_DIRECTORIESto respect local execution restrictions.No real-model Behavior/Impact quality or distillation evaluation was run; the integration test verifies the tool contract, not analysis quality.
Checklist
go fmt,go vet)AI/LLM Disclosure
Implementation and PR preparation used Codex CLI with
gpt-6-astra(the model identifier recorded in the session metadata). The required automated pre-commit review used OpenCodeReview (ocr) withgpt-6-astra.No AI attribution trailers are included in commits. Human self-review, CLA status, and the author-understanding/responsibility checklist remain unchecked for the author to confirm; automated checks do not establish those attestations.
Related Issues
None.