Skip to content

fix(adapters): avoid Gemini rejection of tool catalog guidance - #8792

Merged
lidge-jun merged 1 commit into
lidge-jun:devfrom
zhuxt2015:codex/gemini-tool-prompt-compat
Nov 17, 2026
Merged

lidge-jun merged 1 commit into
lidge-jun:devfrom
zhuxt2015:codex/gemini-tool-prompt-compat

Conversation

@zhuxt2015

@zhuxt2015 zhuxt2015 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Antigravity Gemini 3.8 Flash can reject tool-bearing requests with 429 RESOURCE_EXHAUSTED because of one sentence injected by the shared tool-catalog nudge. In live same-account probes, plain requests and disabled tools succeeded; the original sentence alone reproduced the refusal, while the replacement succeeded in both ordinary and Codex code-mode prompts.
  • Replace only that sentence with “References to other functions in text do not add callable functions.” Existing tool-name/argument constraints, nested-helper execution, deferred ALL_TOOLS discovery and the code-mode host contract remain unchanged. No error classification, quota handling, credential or routing changes.
  • Update the shared nudge assertions, add ordinary/code-mode CCA wire regressions, and document the compatibility behavior.

Verification

  • bun test tests/adapters/tool-catalog-nudge.test.ts tests/adapters/google/google-adapter.test.ts: red/green confirmed. The unpatched source failed the four updated/new wording assertions; the patched source passed all 80 tests.
  • On final head fd12d96, bun run typecheck: no type errors in 2,536 files.
  • bun test tests/adapters/tool-catalog-nudge.test.ts tests/adapters/google/google-adapter.test.ts tests/adapters/google/google-tool-schema-contract.test.ts tests/adapters/google/google-tool-result-adjacency.test.ts tests/adapters/google/google-signature-history-roundtrip.test.ts tests/providers/kiro/kiro-tool-catalog.test.ts tests/ci-workflows/structure-ssot.test.ts: 260 passed, 0 failed.
  • bun run privacy:scan and bun run structure:check: passed.
  • Live Gemini 3.8 Flash/high after applying the identical one-line patch to the local 2.100.2 runtime: non-streaming and SSE function_call -> local execution -> function_call_output continuations each returned an unpredictable result exactly; a real Codex Gemini subagent executed pwd and a diagnostic printf through exec -> tools.exec_command, both exit code 0. These are manual upstream compatibility probes, not claims that an offline mock can enforce Google's acceptance policy.
  • bun run test:changed was attempted but did not complete in the sparse/partial checkout and was interrupted; not reported as passing. The full suite was not run: importing the shared nudge fans out across adapters and the resource/sparse-checkout cost is disproportionate to this one-line compatibility change. Focused semantic and wire tests above passed; broader Ubuntu and cross-platform coverage remains to CI.
  • cd docs-site && bun install --frozen-lockfile && bun run build: passed; 775 pages built, 117,814 internal links checked.
  • Rebased onto dev at e87572127d7804216ebfcf0feecaf4c22c181748 before push. Independent review found no blocking semantic issue in the wording change.

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. No security-sensitive behavior is changed.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

Summary by CodeRabbit

  • Bug Fixes
    • Updated Google adapter tool guidance for Gemini 3.8 Flash. Available tools, argument constraints, and code-mode guidance remain unchanged, and genuine quota errors are still reported.
  • Documentation
    • Clarified that references to other functions in text do not make them callable tools.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The shared tool-catalog guidance now says that textual references to other functions do not add callable functions. Tests check the wording and Gemini 3.8 Flash compatibility. Documentation describes the wording and states that tools, argument constraints, and code-mode helper rules remain unchanged.

Changes: Tool-boundary guidance

Layer / File(s) Summary
Update tool-boundary wording and checks
src/adapters/tool-catalog-nudge.ts, tests/adapters/tool-catalog-nudge.test.ts, tests/adapters/google/google-adapter.test.ts, docs-site/src/content/docs/reference/adapters.md, structure/providers-and-adapters.md
The guidance replaces a specific list of textual contexts with a general statement about references to other functions. Tests check the wording and Gemini 3.8 Flash configurations. Documentation describes the reported rate-limit result and states that tool declarations and related guidance remain unchanged.

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

Change: Bug fix

Merge Risk: Minimal · up to fd12d

This updates the wording of the shared tool-catalog guidance so Gemini 3.8 Flash no longer refuses it with a 429 RESOURCE_EXHAUSTED error. Tool names, argument constraints and code-mode helper rules are unchanged. No actionable merge risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(adapters): avoid Gemini rejection of tool catalog guidance" matches the main change. The PR replaces one sentence in the shared tool-catalog nudge (src/adapters/tool-catalog-nudge.ts) w…
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.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "fix(adapters): avoid Gemini rejection of tool catalog guidance" matches the main change. The PR replaces one sentence in the shared tool-catalog nudge (src/adapters/tool-catalog-nudge.ts) with "References to other functions in text do not add callable functions," which the author reports avoids 429 RESOURCE_EXHAUSTED refusals from Gemini 3.8 Flash. The title is specific, concise, and follows conventional commit style. The changed files are docs, the nudge source, and tests, all consistent with the title.

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e875721 and fd12d96.

Files selected for processing: 5

  • docs-site/src/content/docs/reference/adapters.md
  • src/adapters/tool-catalog-nudge.ts
  • structure/providers-and-adapters.md
  • tests/adapters/google/google-adapter.test.ts
  • tests/adapters/tool-catalog-nudge.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.

@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

✅ READY

  • all PR quality gates passed; the review readiness checklist is complete.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request has been marked Ready for Review.
The review-ready label marks this PR as ready; review automation runs independently.
Maintainers notified: @lidge-jun @Ingwannu

Hygiene

✅ Deterministic PR hygiene checks passed.

@zhuxt2015
zhuxt2015 marked this pull request as ready for review November 16, 2026 03:40
@github-actions
github-actions Bot marked this pull request as draft November 16, 2026 03:40
@github-actions
github-actions Bot marked this pull request as ready for review November 16, 2026 06:30

@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.

Reviewed the complete five-file diff at fd12d96ea11cc8b3744b9387d2f9ed538d7e4ada. The replacement sentence retains the declared-tool boundary, wire names and nested-helper semantics, and the Google wire tests cover both the ordinary catalog and code-mode request. The owning documentation explains the compatibility intent without changing quota handling.

Hosted Ubuntu CI 43795503958 passed, including the actual Google adapter/nudge tests and docs build. This supports the narrow wording change. It does not establish why the reported account received a 429 or demonstrate that this prevents account restrictions. Approval is for this head; refresh stale dev ancestry/readiness before integration. No live account or model call was made.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration into dev under MAINTAINERS.md (not an approving review), 2026-11-17 triage round.

@lidge-jun
lidge-jun merged commit ec1bdf1 into lidge-jun:dev Nov 17, 2026
44 of 53 checks passed
lidge-jun added a commit that referenced this pull request Nov 17, 2026
…guard, Spanish adapters parity) (#8874)

* docs(es): add the Gemini tool-catalog guidance line to the Spanish adapters reference

#8792 added a reference/adapters.md bullet naming `429 RESOURCE_EXHAUSTED`; its PR CI predated the
Spanish localization identifier check, so dev now fails docs-spanish-localization. This adds the
matching Spanish bullet.

* fix(tests): let the network guard pass WebSocket over Unix sockets

#8872 refused every scheme outside http(s)/ws(s)/data/blob/file, which included ws+unix:.
Local and remote messaging reach their daemon through ws+unix:// WebSockets, so the guard
rewrote them to its refused socket and the messaging suites failed on dev with
daemon_unavailable and remote_control_unknown. ws+unix: and wss+unix: never leave the
machine, so they are allowed like data:, blob: and file:.
CATMIAOZHI added a commit to CATMIAOZHI/opencodex that referenced this pull request Nov 18, 2026
Adapt upstream lidge-jun#8792 for Cloud Code Assist while retaining other providers prompt bytes.

Co-authored-by: zhuxt2015 <13765310+zhuxt2015@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working review-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants