Skip to content

fix(chat): preserve raw Copilot tool arguments - #2024

Merged
devswha merged 1 commit into
devswha:mainfrom
YuuuXie:fix/copilot-raw-tool-input
Oct 26, 2026
Merged

devswha merged 1 commit into
devswha:mainfrom
YuuuXie:fix/copilot-raw-tool-input

Conversation

@YuuuXie

@YuuuXie YuuuXie commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Change

Copilot can persist tool arguments as raw strings, including invalid JSON inside an otherwise valid event. Preserve bounded raw input for display and best-effort parse it only for summaries, following the existing Hermes/Codex readers.

Keep call-ID/name validation, root/subagent filtering, request/result association and signed offset-based output retrieval unchanged. Arrays and other unsupported assistant-request containers remain rejected.

Tracks YuuuXie#3. Independent branch from upstream main e04cb9f9; no personal deployment tooling.

Validation

  • Copilot unit regressions: 52 passed, including both assistant requests and execution-start events, valid/invalid/scalar/oversized string input, failed results and verified full-output retrieval.
  • Independent code/results review: no significant issues.
  • bun run check fast: workflow syntax, generated files, typecheck and build passed. Unit suite: 7,286 passed, 3 failed, 24 skipped; failures were unchanged Codex/composer timing bounds and the installer's 19-second lower bound, not Copilot regressions.
  • Focused rechecks: Codex 75 passed and composer delivery 28 passed. The unchanged installer still misses its timing lower bound by approximately 28 ms on this host; it is not reported as passing and no timeout/assertion was weakened.

Full browser/integration lanes and native Windows were not run locally for this parser-only fix. Upstream CI and maintainer merge remain required.

Refs #3

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1fad73aa-cbc5-42dd-916b-64e5198bc512
@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: devswha/ovis
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: e49276d
  • Layers: Repository YAML
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e1bf4a3b-1951-4790-be4e-efb691b34fea
Commits

Reviewing files that changed from the base of the PR and between e49276d and cc842f8.

Files selected for processing: 3
  • changelog.d/copilot-raw-tool-input.md
  • server/copilot.test.ts
  • server/copilot.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved Copilot Chat conversation readability when tool arguments are provided as strings, including non-JSON input.
    • Tool inputs remain visible up to 16,000 characters, and tool outputs and final answers remain available.
    • Valid JSON string arguments continue to produce useful tool summaries, while failed tool results are identified as errors.

Copilot now accepts string-valued tool arguments, uses best-effort JSON parsing for summaries, and preserves the original string as tool input. Tests cover valid and malformed JSON, freeform text, bounded input display, and tool output references.

Changes: Copilot tool input

Layer / File(s) Summary
String argument handling
server/copilot.ts, server/copilot.test.ts, changelog.d/copilot-raw-tool-input.md
Assistant tool-request validation accepts string arguments. addTool parses valid JSON strings for summaries and uses an empty object when parsing fails, while storing string input verbatim. Tests cover display limits, output references, errors, and final-answer retention. The changelog records the fix.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related issues

  • devswha/ovis#1574: This change supports displaying tool activity in Copilot transcripts, but does not implement the full native transcript adapter.

Possibly related PRs

  • devswha/ovis#1956: Both changes affect Copilot tool-output references; this PR’s tests check that output references remain retrievable.
  • devswha/ovis#1652: Both changes extend Copilot transcript parsing for tool requests and results.
Merge Risk: Minimal · up to cc842

String tool arguments retain bounded raw input for display, with no identified issue blocking merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preserving raw Copilot tool arguments in chat.
Description check Passed The description includes the required Change and Validation sections. It explains the behavior, preserved constraints, related issue, test coverage, known unrelated failures, and unrun environments.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha

devswha commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Verified at cc842f8, rebased locally onto current main (7c0f34c) without conflicts.

  • bun test server/copilot.test.ts: 53 pass, 0 fail.
  • bun run check fast: exit 0, 7,431 pass / 0 fail / 24 skip.
  • Reverting only server/copilot.ts makes both new string-argument tests fail (assistant requests become unavailable, execution-start input becomes {}); restoring it passes them.
  • server/copilot.contract.test.ts cannot detect its Copilot stand-in on this host; the same setup failure happens on main, so it says nothing about this PR.

No findings: call-ID/name validation, unsupported-container rejection and offset output retrieval are unchanged. Ready for the merge pass. Thanks, @YuuuXie.

@devswha

devswha commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Thanks @YuuuXie. The merge-pass gate found nothing in the code. Raw-input bounds, malformed input, text rendering, root/subagent filtering and signed output retrieval all hold, and the unit suite passes on top of main (7431/0). Both new tests fail without the change. One small request: please add the contributor credit to changelog.d/copilot-raw-tool-input.md, ending the entry with ([#2024](https://github.com/devswha/ovis/pull/2024) by @YuuuXie) as other fragments do. After that it can be merged.

@devswha

devswha commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Correction from the merge pass: no changelog change is needed after all. Per changelog.d/README.md, a maintainer adds by @login for outside contributors when the release folds the fragments. Please ignore my earlier request. This PR merges as it stands, in its turn.

@devswha

devswha commented Oct 26, 2026

Copy link
Copy Markdown
Owner

Merge pass review report. Overall: PASSED. This outside contribution from @YuuuXie keeps Copilot's raw tool arguments. The maintainer approved merging it once the gate passed, and the gate (omo-native-gate-reviewer, gpt-6-astra) passed it.

What it does: Copilot can store tool arguments as raw strings, including invalid JSON. Ovis now keeps a bounded copy of that raw input for display, and parses it best-effort only to build summaries, the same way the Hermes and Codex readers do.

Gate verification:

  • These pass review: the bounds on raw input, handling of malformed input, text-only rendering, root/subagent filtering, and signed offset-based output retrieval.
  • Copilot tests pass 53/53, and typecheck passes.
  • Merged locally into main, the CI-style unit run passes 7431, with 0 failures.
  • Reverting the production change makes both new tests fail: assistant requests become unavailable, and execution-start input becomes {}.

A maintainer adds the changelog credit when the release folds the fragments (changelog.d/README.md).

@devswha
devswha merged commit 560ad22 into devswha:main Oct 26, 2026
19 checks passed
@YuuuXie
YuuuXie deleted the fix/copilot-raw-tool-input branch October 27, 2026 13:04
@devswha devswha mentioned this pull request Oct 27, 2026
devswha added a commit that referenced this pull request Oct 27, 2026
## Release 0.4.19

The release PR, made by the steps in
[docs/development.md#releasing](docs/development.md#releasing), on main
9d76cca (#2078):

- **Version:** `version` is 0.4.19 in `package.json` and
`herdr-plugin.toml`.
- **Changelog:** `bun scripts/changelog-fold.ts 0.4.19` moved the
`changelog.d` fragments of 54 PRs into CHANGELOG.md, with PR links, and
deleted them.
- Outside contributors are credited: #1955 @YuuuXie, #1957 @Noobear,
#1984 @bonecool999, #2003 @philipprass-prog, #2016 @kyop21, #2024
@YuuuXie, #2025 @YuuuXie, #2027 @jpcarranza94, #2030 @phlips5437, #2031
@yaaayaaa, #2034 @jpcarranza94, #2035 @nahwan-kim, #2041 @odfalik, #2045
@mattmarcin, #2052 @jpcarranza94, #2057 @kyop21, #2061 @YuuuXie.
- **Release summaries:** `release-summaries.json` has the 0.4.19 entry
in en, ko, ja and zh, with the same lists in each: 5 new, 5 improved, 5
fixed. Every English line is at most 70 characters.
- **Remote bundle:** `REMOTE_BUNDLE_VERSION` goes from 37 to 38 in
`shared/machines.ts`, because the remote bundle's inputs changed since
`remote-v37`. Once this merges, `remote-v38` is pushed on the merge
commit, and the Remote PC bundles workflow has to finish before the
Release run.

`bun scripts/release-guards.ts` reports: "Release 0.4.19: remote bundle,
telemetry Worker and release metadata are in order." No telemetry Worker
deploy is needed. `bun run check fast` passes locally.

**Not checked on a real Windows PC:** #1989 (Git for Windows' OpenSSH
for remote PCs) and #2016 (Antigravity chat on Windows through the
Restart Manager) ship without their real-device Windows checks, because
the maintainer's Windows test PC is off. The owner accepted releasing
without them. Both will be checked on the real PC when it is back.

The owner approved this release.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants