Skip to content

fix(google): keep Gemini progress-history splitting linear - #7332

Closed
luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/gemini-progress-history-linear-20261019
Closed

luvs01 wants to merge 1 commit into
lidge-jun:devfrom
luvs01:fix/gemini-progress-history-linear-20261019

Conversation

@luvs01

@luvs01 luvs01 commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Repeated prefix slicing and trimming at candidate sentence boundaries can make synchronous Gemini progress-history processing grow quadratically. Use a fixed-size suffix for boundary exceptions and scan intervening whitespace once to keep the split linear in text length.
  • Preserve abbreviation, list-marker, Unicode whitespace, closing-character and code-fence behavior. Final answers and client-visible output remain unchanged.
  • Add bounded-work and parser-to-adapter regressions; update the Google provider contract.

Verification

Prior frozen-candidate validation on Bun 1.4.3 (not rerun for publication or readiness):

bun test ./tests/adapters/google/gemini-progress-history.test.ts ./tests/adapters/google/google-vertex-thought-signature.test.ts ./tests/adapters/google/google-antigravity-replay.test.ts ./tests/adapters/google/google-antigravity-wire.test.ts ./tests/adapters/google/gemini-4-argon-antigravity.test.ts
  • That single five-file run recorded 191 pass / 0 fail / 608 assertions / exit 0.
  • A separate seeded 50,000-case baseline/candidate semantic comparison using bun --eval passed with exit 0. It is not part of the 191-test total.
  • bun node_modules/typescript/lib/tsc.js --noEmit passed with exit 0. The earlier bun run typecheck wrapper exited 1 during binary remapping/process creation; the direct compiler command above succeeded.
  • Regression coverage checks linear text-inspection work and preserves commentary projection, final answers and parser history.
  • The local changed/full suites were not run under the agreed focused-validation scope; real-provider E2E remains unverified. No live-service interruption is claimed.

Current-head hosted CI at 794d41d9263fada54e57dd616b67bfedc866ede2: Cross-platform CI 39154029094 completed successfully, including test 1/4, test 2/4, test 3/4 and test 4/4. Skipped jobs are not executed platform validation. Hosted CI results are separate from the local records above.

This PR is ready for maintainer review. Maintainer security review and any required Code Owner approval remain pending before merge.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.
  • CI passed on the current head 794d41d9263fada54e57dd616b67bfedc866ede2.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Gemini progress-history sentence splitting, including handling for abbreviations, list markers, whitespace, and code fences.
    • Preserved the original progress text when processing requests, preventing changes to the recorded history.

Replace growing-prefix boundary checks with fixed-size suffix checks and one-pass whitespace tracking. Preserve progress-history semantics with bounded-work and parser/adapter regressions, and update the provider contract.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: f3cf9664-77bf-46df-aa83-f8a30140902b
📥 Commits

Reviewing files that changed from the base of the PR and between 8640c2f and 794d41d.

📒 Files selected for processing: 3
  • src/adapters/google-progress-history.ts
  • structure/providers/google.md
  • tests/adapters/google/gemini-progress-history.test.ts

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

📝 Walkthrough

The Google adapter now scans progress text by newline-delimited intervals and checks sentence exceptions against a fixed-size suffix. Tests cover lead extraction, inspection bounds, and progress-history projection into Google requests.

Changes: Gemini progress-history splitting

Layer / File(s) Summary
Progress-lead scanning
src/adapters/google-progress-history.ts:30,46-65, structure/providers/google.md:175-176
The splitter tracks the latest non-whitespace content position while scanning newline-delimited intervals. It checks sentence exceptions against at most the final five characters. The documentation describes these mechanics.
Splitter and request-projection tests
tests/adapters/google/gemini-progress-history.test.ts:5,49-119
Tests cover text-inspection bounds and lead extraction cases. They also check parsed progress history and projected model turns for commentary and final_answer phases.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: lidge-jun

Merge Risk: ⚪ Minimal · up to 794d4

No compatibility issue was found in the progress-history split; the change is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: keeping Gemini progress-history splitting linear in text length. It matches the implementation, tests, documentation, and stated PR objective…
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: Title check

Explanation

The title clearly and concisely describes the main change: keeping Gemini progress-history splitting linear in text length. It matches the implementation, tests, documentation, and stated PR objective.

Full details: Docstring Coverage

Explanation

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

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ 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.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 18, 2026
@luvs01
luvs01 marked this pull request as ready for review October 18, 2026 18:51

@Ingwannu Ingwannu left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness approval at 794d41d (current dev base 8640c2f). The bounded suffix check preserves list-marker, abbreviation and Unicode/newline semantics while avoiding repeated prefix scans.

Independent Linux/Bun 1.4.3 focused regression: 8 passed, 0 failed in fresh homes under the documented cgroup limits. Current-head Cross-platform CI 39154029094 is successful, including the root Typecheck in gates and all four Ubuntu test shards. Broader Ubuntu validation is supplied by the hosted checks; the full local suite was not run under this host's resource cap. This is not macOS/Windows runtime certification. Mapped contract changes and the focused tests agree. No merge or workflow dispatch performed.

@lidge-jun

Copy link
Copy Markdown
Owner

Carried into #7394 (squash 74463a2) on dev with a Co-authored-by trailer, as part of the B4 provider-adapter bundle. It ships in the next release (2.90.0). Thanks!

@lidge-jun lidge-jun closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants