Skip to content

fix(cli,engine): sota papers field queries and --help, grep on long lines - #2182

Open
jacktrnr wants to merge 2 commits into
mainfrom
fix/2131-sota-grep
Open

jacktrnr wants to merge 2 commits into
mainfrom
fix/2131-sota-grep

Conversation

@jacktrnr

Copy link
Copy Markdown
Contributor

Refs #2131. This fixes the two bug parts of the issue. The Slack draft-before-post and file-upload part is a feature, so it is not in this PR and #2131 stays open for it.

Root causes

1. amico sota papers field queries returned HTTP 400. arxivApiUrl put all: in front of every term. --query 'ti:"noise-induced heating"' therefore went out as all:ti:"noise-induced heating", which arXiv rejects. The URL encoding itself was fine. Now a term that already names an arXiv field (ti:, au:, abs:, co:, jr:, cat:, rn:, id:, all:) is sent as written. Bare terms still get the all: default.

amico sota papers --help returned an error. sotaVerb checked --query before it looked for a help flag. Now amico sota --help and amico sota <lens> --help (or -h) return {verb, usage} and exit 0, the same way other verbs handle help.

2. grep failed on very long lines. Ripgrep.grep (core, packages/core/src/ripgrep.ts) treated any ripgrep JSON record over its 64 KB cap as a fatal Ripgrep.Error. As a result, one minified or generated line threw away every other match in the search. Now the over-long record is skipped, the 64 KB cap still limits what gets parsed, and the remaining matches come back. This is an overlay change: ripgrep.ts moved into the overlay and manifest.json was refreshed.

The issue also reported glob failing with "ripgrep execution failed". glob calls rg --files, which emits no per-line records, so long lines cannot trigger it there. I could not reproduce it, and this PR does not change glob.

Tests (written first, each seen failing)

  • packages/amico-run/test/sota_papers.test.ts: a field-prefixed query passes through as written (checks URL construction only, no network calls).
  • packages/amico-run/test/sota_verb.test.ts: papers --help, papers -h and --help exit 0 with usage.
  • packages/app-bundle/overlay/packages/opencode/test/tool/grep-long-line.test.ts: a file containing a 200 KB matching line still returns the matches on the other lines and in other files. Before the fix it failed with Ripgrep JSON record exceeded 65536 bytes.

Verification

  • amico-run: targeted sota suites pass. Full suite: 2426 passed, 2 failed. The 2 failures are in upgrade-server-binary.test.ts, a file this PR does not touch, and it passes 14/14 when run on its own (they look like load-related flakes).
  • amico-run tsc --noEmit is clean.
  • Engine: grep-long-line, grep, glob and core ripgrep tests all pass.
  • engine_typecheck_gate.sh is OK (only the Base-pin drift: manifest upstream_base_sha stale vs absorbed overlay #1229 allowlisted errors). overlay_typecheck_gate.sh is OK.
  • refresh_manifest.mjs, then drift_gate.mjs: PASS.

🤖 Generated with Claude Code

Jackson Turner and others added 2 commits November 23, 2026 17:05
arxivApiUrl prefixed every term with all:, so a field query such as
ti:"phrase" became all:ti:"phrase", which the arXiv API rejects with
HTTP 400. Field-prefixed terms now pass through verbatim. `amico sota
--help` and `amico sota <lens> --help` now print usage and exit 0.

Refs #2131

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…2131)

Ripgrep.grep failed the whole search with "Ripgrep JSON record exceeded
65536 bytes" when any matching line (minified HTML, generated data)
produced a JSON record over the 64 KB cap. The over-long record is now
skipped and the remaining matches are returned. Overlay manifest
refreshed.

Refs #2131

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f531eacc-b53f-4089-8c3d-1067da43d592
  • 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

@jacktrnr
jacktrnr marked this pull request as ready for review November 23, 2026 22:20
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.

1 participant