@google/gemini-cli-core 0.55.0 → 0.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,185 @@
1
+ # Behavioral Evaluations & EDK Guide
2
+
3
+ This guide introduces the **Eval Development Kit (EDK)** and details how to
4
+ write, validate, run, and report on **behavioral evaluations** in the Gemini CLI
5
+ codebase.
6
+
7
+ ---
8
+
9
+ ## Overview
10
+
11
+ Behavioral evaluations are automated tests designed to assert on the
12
+ **behavior** of the Gemini CLI agent (e.g., verifying which tools are called,
13
+ checking call ordering, or avoiding destructive commands) rather than checking
14
+ the final prose output.
15
+
16
+ Evaluating agent behavior is critical because:
17
+
18
+ 1. Model responses are non-deterministic, making exact prose matching highly
19
+ fragile.
20
+ 2. We must ensure the model utilizes the most efficient tools (e.g., batching
21
+ files via `read_many_files` instead of sequential `read_file` calls).
22
+ 3. We must enforce safety boundaries (e.g., preventing execution of raw shell
23
+ commands when safe alternatives exist).
24
+
25
+ All behavioral evaluations are stored under the `evals/` directory.
26
+
27
+ ---
28
+
29
+ ## EDK Developer Commands
30
+
31
+ The EDK provides CLI tools under `scripts/` to help contributors audit, check,
32
+ and monitor evals.
33
+
34
+ ### 1. `npm run eval:inventory`
35
+
36
+ Scans all eval files under `evals/`, statically parses them, and provides a
37
+ structured overview of what exists in the repository.
38
+
39
+ - **Usage:**
40
+ ```bash
41
+ npm run eval:inventory
42
+ ```
43
+ - **JSON Output:** For CI integration or inventory indexing, generate a
44
+ machine-readable JSON report:
45
+ ```bash
46
+ npm run eval:inventory -- --json
47
+ ```
48
+ - **Custom Root:** Run against another directory or repository:
49
+ ```bash
50
+ npm run eval:inventory -- --root /path/to/other/repo
51
+ ```
52
+
53
+ ---
54
+
55
+ ### 2. `npm run eval:validate`
56
+
57
+ A lint-like checker that validates eval source files against standard structural
58
+ guidelines and best practices.
59
+
60
+ - **Usage:**
61
+ ```bash
62
+ npm run eval:validate
63
+ ```
64
+ - **Custom Scopes:** Validate a specific file:
65
+ ```bash
66
+ npm run eval:validate -- evals/my-test.eval.ts
67
+ ```
68
+
69
+ #### Validation Rules & Severities
70
+
71
+ | Rule ID | Severity | Description |
72
+ | :------------------- | :---------- | :--------------------------------------------------------------------------------------------------------------------- |
73
+ | `file-naming` | **Error** | File must match `*.eval.ts` or `*.eval.tsx` naming conventions. |
74
+ | `valid-policy` | **Error** | Policy must be one of `ALWAYS_PASSES`, `USUALLY_PASSES`, or `USUALLY_FAILS`. |
75
+ | `suite-metadata` | **Error** | Both `suiteName` and `suiteType` must be present as static string literals. |
76
+ | `prompt-presence` | **Error** | Every eval case must have a non-empty `prompt` string. |
77
+ | `case-name-static` | **Error** | The case name must be a static string literal, not computed dynamically. |
78
+ | `invalid-tool-refs` | **Error** | All tools referenced in assertions must match known built-in or legacy tools. |
79
+ | `positive-assertion` | **Error** | Evaluation cases must assert on at least one tool call (e.g., check `waitForToolCall` has been invoked). |
80
+ | `workspace-setup` | **Error** | Workspace behaviors (like file-system edits/reads) must set up a `files` object. |
81
+ | `new-evals-policy` | **Warning** | New evals must not use `ALWAYS_PASSES` policy initially (they should be promoted after nightly data proves stability). |
82
+
83
+ Warnings (`new-evals-policy`) will be logged with `⚠` and will **not** cause
84
+ the CLI process to exit with status `1`. Errors (`✗`) will block CI builds and
85
+ return exit status `1`.
86
+
87
+ ---
88
+
89
+ ### 3. `npm run eval:report`
90
+
91
+ Aggregates local vitest `report.json` artifacts, maps them against inventory
92
+ policies, and summarizes the pass rates per model.
93
+
94
+ - **Usage:**
95
+ ```bash
96
+ npm run eval:report
97
+ ```
98
+ By default, it scans `evals/logs/` recursively for `report.json` files.
99
+ - **Specifying Directory:**
100
+ ```bash
101
+ npm run eval:report -- /path/to/logs
102
+ ```
103
+ - **JSON Output:**
104
+ ```bash
105
+ npm run eval:report -- --json
106
+ ```
107
+
108
+ ---
109
+
110
+ ## Contributor Workflow
111
+
112
+ When writing a new behavioral evaluation, adhere to this workflow to ensure
113
+ high-quality, non-flaky test runs.
114
+
115
+ ### Step-by-Step Guide
116
+
117
+ 1. **Identify the Target Behavior**: Determine which tool calls need
118
+ verification (e.g., `web_fetch` must be called).
119
+ 2. **Author the Eval File**: Create your file under `evals/<name>.eval.ts`
120
+ naming it properly.
121
+ 3. **Configure Workspace Files**: If the eval reads or edits files, define them
122
+ inside the `files` metadata field.
123
+ 4. **Assert Behavior, Not Prose**: Ensure the `assert` block checks tool
124
+ interactions using `rig.waitForToolCall` or similar. Do not check final
125
+ prose.
126
+ 5. **Run Locally**:
127
+ ```bash
128
+ RUN_EVALS=true npx vitest run evals/my-test.eval.ts
129
+ ```
130
+ 6. **Deflake**: Run your eval at least 3 times locally to verify it does not
131
+ fail due to model variance.
132
+ 7. **Run Validation**: Run `npm run eval:validate` to ensure no linting errors
133
+ are present.
134
+
135
+ ### Acceptance Criteria Checklist
136
+
137
+ - [ ] **Naming**: File ends with `.eval.ts` or `.eval.tsx`.
138
+ - [ ] **Policy**: New evals start as `USUALLY_PASSES`.
139
+ - [ ] **Metadata**: Static `suiteName` and `suiteType` (e.g. `'behavioral'`) are
140
+ specified.
141
+ - [ ] **Assertions**: Uses `rig.waitForToolCall` or asserts tool arguments
142
+ explicitly.
143
+ - [ ] **Clean workspace**: Does not write to files outside `rig.testDir`.
144
+
145
+ ### Common Anti-Patterns to Avoid
146
+
147
+ - **Restricting core tools**: Never override `settings.tools.core` to limit
148
+ tools. Evals must run against the default toolset.
149
+ - **Checking model prose**: Avoid `expect(result).toContain('something')` since
150
+ model wording is non-deterministic.
151
+ - **Integration-only testing**: Evals that only write files without checking
152
+ realistic model prompts are integration tests and belong under
153
+ `integration-tests/`.
154
+
155
+ ---
156
+
157
+ ## CI & Dashboard Integration
158
+
159
+ You can easily automate behavioral evaluations or compile dashboard data using
160
+ EDK's JSON reporters.
161
+
162
+ ### CI Validation Block
163
+
164
+ Add a step in your PR checks or GitHub workflows to automatically lint new evals
165
+ and block pull requests containing validation errors:
166
+
167
+ ```yaml
168
+ - name: Run Eval Validator
169
+ run: npm run eval:validate
170
+ ```
171
+
172
+ ### Publishing to a Dashboard
173
+
174
+ To record nightly performance metrics across multiple models:
175
+
176
+ 1. Configure your workflow to run evaluations with the JSON reporter:
177
+ ```bash
178
+ cross-env GEMINI_MODEL=gemini-2.5-pro npx vitest run --config evals/vitest.config.ts --reporter=json --outputFile="evals/logs/eval-logs-gemini-2.5-pro/report.json"
179
+ ```
180
+ 2. Aggregate all test runs using the reporting tool:
181
+ ```bash
182
+ npm run eval:report -- evals/logs --json > aggregated_report.json
183
+ ```
184
+ 3. Upload `aggregated_report.json` to your dashboard storage backend to
185
+ visualize pass rates over time.
@@ -18,6 +18,24 @@ on GitHub.
18
18
  | [Preview](preview.md) | Experimental features ready for early feedback. |
19
19
  | [Stable](latest.md) | Stable, recommended for general use. |
20
20
 
21
+ ## Announcements: v0.54.0 - 2026-08-06
22
+
23
+ - **PR Automation & Antigravity Agent:** Integrated the Antigravity agent runner
24
+ with dual-locking Firestore concurrency controls to secure the PR generator
25
+ ([#28434](https://github.com/google-gemini/gemini-cli/pull/28434),
26
+ [#28432](https://github.com/google-gemini/gemini-cli/pull/28432) by
27
+ @joneba-google).
28
+ - **Caretaker Triaging & Security:** Enhanced caretaker triage to post comments
29
+ prior to auto-closing issues and sanitized issue titles under untrusted
30
+ context ([#28411](https://github.com/google-gemini/gemini-cli/pull/28411),
31
+ [#28352](https://github.com/google-gemini/gemini-cli/pull/28352) by @chadd28).
32
+ - **Security and Session Robustness:** Prevented cleartext credential leakage by
33
+ enforcing HTTPS, rotated session IDs on model fallbacks, and skipped merged
34
+ function-response turns in active loops
35
+ ([#28517](https://github.com/google-gemini/gemini-cli/pull/28517) by
36
+ @amelidev, [#28565](https://github.com/google-gemini/gemini-cli/pull/28565) by
37
+ @adamfweidman).
38
+
21
39
  ## Announcements: v0.53.0 - 2026-07-28
22
40
 
23
41
  - **Caretaker Triage Orchestration:** Implemented an LLM triage orchestrator and
@@ -1,6 +1,6 @@
1
- # Latest stable release: v0.53.0
1
+ # Latest stable release: v0.54.0
2
2
 
3
- Released: July 28, 2026
3
+ Released: August 6, 2026
4
4
 
5
5
  For most users, our latest stable release is the recommended release. Install
6
6
  the latest stable version with:
@@ -11,38 +11,66 @@ npm install -g @google/gemini-cli
11
11
 
12
12
  ## Highlights
13
13
 
14
- - **Caretaker Triage Orchestrator:** Implemented an LLM triage orchestrator and
15
- container build setup to manage automated caretakers.
16
- - **Eval Coverage Reporting:** Introduced a new command for generating
17
- evaluation coverage reports to track agent decision logic and testing.
18
- - **Security and Sandboxing:** Aligned macOS permissive Seatbelt profiles with
19
- the deny-default model, and enforced workspace trust with task isolation in
20
- the A2A server.
21
- - **Robust Conversation Loops:** Coalesced consecutive message roles and grouped
22
- cancelled tool responses to avoid Bad Request errors, and mitigated infinite
23
- ReAct loops and prompt injection vulnerabilities.
14
+ - **PR Generation & Antigravity Agent:** Implemented Firestore concurrency
15
+ dual-locking mechanisms in the database and introduced the Antigravity agent
16
+ runner with comprehensive prompt templates.
17
+ - **Caretaker Triaging & Issue Security:** Improved the caretaker triage loop to
18
+ post a descriptive comment prior to auto-closing issues, and sanitized issue
19
+ titles within an untrusted context to ensure secure processing.
20
+ - **Enhanced Authentication & Security:** Enforced strict HTTPS validation for
21
+ GoogleCredentialsAuthProvider to block cleartext leakage, and implemented tag
22
+ length validation for the file keychain system.
23
+ - **Model Fallback & History Filtering:** Resolved stateful API errors by
24
+ rotating session IDs on model fallback, optimized conversation history
25
+ retrieval by filtering out thought parts when context management is disabled,
26
+ and correctly skipped merged function responses when tracking active loops.
24
27
 
25
28
  ## What's Changed
26
29
 
27
- - fix(core,a2a): group cancelled tool responses and coalesce consecutive roles
28
- to prevent 400 Bad Request by @luisfelipe-alt in
29
- [#28407](https://github.com/google-gemini/gemini-cli/pull/28407)
30
- - feat(caretaker-triage): implement LLM triage orchestrator and container build
31
- by @chadd28 in
32
- [#28345](https://github.com/google-gemini/gemini-cli/pull/28345)
33
- - refactor(cli): align macOS permissive Seatbelt profiles with deny-default
34
- model by @ompatel-aiml in
35
- [#28424](https://github.com/google-gemini/gemini-cli/pull/28424)
36
- - fix(core): mitigate infinite ReAct loops and prompt injection loops by
37
- @amelidev in [#28429](https://github.com/google-gemini/gemini-cli/pull/28429)
38
- - fix(a2a-server): enforce workspace trust and task isolation to prevent RCE by
30
+ - Changelog for v0.53.0-preview.0 by @gemini-cli-robot in
31
+ [#28507](https://github.com/google-gemini/gemini-cli/pull/28507)
32
+ - Changelog for v0.52.0 by @gemini-cli-robot in
33
+ [#28508](https://github.com/google-gemini/gemini-cli/pull/28508)
34
+ - chore(release): bump version to 0.54.0-nightly.20260722.gf743ab579 by
35
+ @gemini-cli-robot in
36
+ [#28510](https://github.com/google-gemini/gemini-cli/pull/28510)
37
+ - fix(caretaker): sanitize and wrap issue title in untrusted_context by @chadd28
38
+ in [#28352](https://github.com/google-gemini/gemini-cli/pull/28352)
39
+ - chore(caretaker): update vitest to v3.2.4 and add package-lock.json files by
40
+ @chadd28 in [#28409](https://github.com/google-gemini/gemini-cli/pull/28409)
41
+ - fix(core): rotate session ID on model fallback to prevent stateful API errors
42
+ by @amelidev in
43
+ [#28469](https://github.com/google-gemini/gemini-cli/pull/28469)
44
+ - feat(caretaker-triage): post comment before auto-closing issues by @chadd28 in
45
+ [#28411](https://github.com/google-gemini/gemini-cli/pull/28411)
46
+ - fix(core): enforce HTTPS for GoogleCredentialsAuthProvider to prevent
47
+ cleartext leakage by @amelidev in
48
+ [#28517](https://github.com/google-gemini/gemini-cli/pull/28517)
49
+ - fix(core): filter out thought parts from getHistoryTurns when context
50
+ management is disabled by @DavidAPierce in
51
+ [#28509](https://github.com/google-gemini/gemini-cli/pull/28509)
52
+ - fix(a2a-server): normalize CRLF line endings to LF in getProposedContent by
39
53
  @luisfelipe-alt in
40
- [#28470](https://github.com/google-gemini/gemini-cli/pull/28470)
41
- - fix(core): sequentially verify cached credentials and restore
42
- GOOGLE_APPLICATION_CREDENTIALS fallback by @luisfelipe-alt in
43
- [#28472](https://github.com/google-gemini/gemini-cli/pull/28472)
44
- - feat(evals): add eval coverage report command by @ved015 in
45
- [#28169](https://github.com/google-gemini/gemini-cli/pull/28169)
54
+ [#28531](https://github.com/google-gemini/gemini-cli/pull/28531)
55
+ - fix(core): enforce explicit tag length and validation in file keychain by
56
+ @luisfelipe-alt in
57
+ [#28523](https://github.com/google-gemini/gemini-cli/pull/28523)
58
+ - chore/release: bump version to 0.54.0-nightly.20260728.gbef611950 by
59
+ @gemini-cli-robot in
60
+ [#28552](https://github.com/google-gemini/gemini-cli/pull/28552)
61
+ - feat(pr-generator-db): implement Firestore concurrency dual-locking and test
62
+ ingestion utilities by @joneba-google in
63
+ [#28432](https://github.com/google-gemini/gemini-cli/pull/28432)
64
+ - feat(pr-generator-agent): implement Antigravity agent runner and prompt
65
+ templates … by @joneba-google in
66
+ [#28434](https://github.com/google-gemini/gemini-cli/pull/28434)
67
+ - fix(core): skip merged function-response turns when finding the active loop by
68
+ @adamfweidman in
69
+ [#28565](https://github.com/google-gemini/gemini-cli/pull/28565)
70
+ - fix(patch): cherry-pick f47d6c6 to release/v0.54.0-preview.0-pr-28566 to patch
71
+ version v0.54.0-preview.0 and create version 0.54.0-preview.1 by
72
+ @gemini-cli-robot in
73
+ [#28609](https://github.com/google-gemini/gemini-cli/pull/28609)
46
74
 
47
75
  **Full Changelog**:
48
- https://github.com/google-gemini/gemini-cli/compare/v0.52.0...v0.53.0
76
+ https://github.com/google-gemini/gemini-cli/compare/v0.53.1...v0.54.0
@@ -1,6 +1,6 @@
1
- # Preview release: v0.54.0-preview.0
1
+ # Preview release: v0.55.0-preview.1
2
2
 
3
- Released: July 28, 2026
3
+ Released: August 06, 2026
4
4
 
5
5
  Our preview release includes the latest, new, and experimental features. This
6
6
  release may not be as stable as our [latest weekly release](latest.md).
@@ -26,6 +26,48 @@ npm install -g @google/gemini-cli@preview
26
26
 
27
27
  ## What's Changed
28
28
 
29
+ - chore(release): bump version to 0.55.0-nightly.20260728.gd29268d36 by
30
+ @gemini-cli-robot in
31
+ [#28569](https://github.com/google-gemini/gemini-cli/pull/28569)
32
+ - Changelog for v0.54.0-preview.0 by @gemini-cli-robot in
33
+ [#28567](https://github.com/google-gemini/gemini-cli/pull/28567)
34
+ - Changelog for v0.53.0 by @gemini-cli-robot in
35
+ [#28568](https://github.com/google-gemini/gemini-cli/pull/28568)
36
+ - chore/release: bump version to 0.55.0-nightly.20260729.g3499c84f7 by
37
+ @gemini-cli-robot in
38
+ [#28573](https://github.com/google-gemini/gemini-cli/pull/28573)
39
+ - fix(core): classify capacity exhaustion as terminal to prevent retry hangs by
40
+ @luisfelipe-alt in
41
+ [#28599](https://github.com/google-gemini/gemini-cli/pull/28599)
42
+ - fix(core,cli): propagate InvalidStreamError details to UI for specific empty
43
+ response guidance by @DavidAPierce in
44
+ [#28566](https://github.com/google-gemini/gemini-cli/pull/28566)
45
+ - fix(cli): fall back to embedded macOS seatbelt profiles if missing by
46
+ @amelidev in [#28551](https://github.com/google-gemini/gemini-cli/pull/28551)
47
+ - feat(pr-generator-core): add environment config parser, command executor,
48
+ GitHub R… by @joneba-google in
49
+ [#28435](https://github.com/google-gemini/gemini-cli/pull/28435)
50
+ - feat(pr-generator-orchestrator): implement iterative bug-fixing state machine
51
+ and container worker entrypoint by @joneba-google in
52
+ [#28433](https://github.com/google-gemini/gemini-cli/pull/28433)
53
+ - feat(pr-generator-infra): configure Cloud Run job, Workflows definition, and
54
+ Dockerfile by @joneba-google in
55
+ [#28431](https://github.com/google-gemini/gemini-cli/pull/28431)
56
+ - fix(release): handle npm dist-tag deletion failures on registries that forbid
57
+ it by @DavidAPierce in
58
+ [#28694](https://github.com/google-gemini/gemini-cli/pull/28694)
59
+ - fix(core): stop a new user message fusing into an unanswered tool response by
60
+ @adamfweidman in
61
+ [#28700](https://github.com/google-gemini/gemini-cli/pull/28700)
62
+ - fix(core,cli): repair /compress session reload and quota-fallback tool
63
+ response loss by @adamfweidman in
64
+ [#28672](https://github.com/google-gemini/gemini-cli/pull/28672)
65
+ - fix(core): preserve functionCall thoughtSignature when stripping thought parts
66
+ by @sarbojitrana in
67
+ [#28607](https://github.com/google-gemini/gemini-cli/pull/28607)
68
+ - fix(core): unwrap and parse nested gaxios streaming errors from cause message
69
+ by @luisfelipe-alt in
70
+ [#28689](https://github.com/google-gemini/gemini-cli/pull/28689)
29
71
  - Changelog for v0.53.0-preview.0 by @gemini-cli-robot in
30
72
  [#28507](https://github.com/google-gemini/gemini-cli/pull/28507)
31
73
  - Changelog for v0.52.0 by @gemini-cli-robot in
@@ -68,4 +110,4 @@ npm install -g @google/gemini-cli@preview
68
110
  [#28565](https://github.com/google-gemini/gemini-cli/pull/28565)
69
111
 
70
112
  **Full Changelog**:
71
- https://github.com/google-gemini/gemini-cli/compare/v0.53.0-preview.0...v0.54.0-preview.0
113
+ https://github.com/google-gemini/gemini-cli/compare/v0.53.0-preview.0...v0.55.0-preview.1
@@ -217,6 +217,10 @@
217
217
  {
218
218
  "label": "Development",
219
219
  "items": [
220
+ {
221
+ "label": "Behavioral evaluations",
222
+ "slug": "docs/behavioral-evals"
223
+ },
220
224
  { "label": "Contribution guide", "slug": "docs/contributing" },
221
225
  { "label": "Integration testing", "slug": "docs/integration-tests" },
222
226
  {
@@ -69,8 +69,8 @@ declare const localAgentSchema: z.ZodObject<{
69
69
  redirect_uri?: string | undefined;
70
70
  token_url?: string | undefined;
71
71
  audiences?: string[] | undefined;
72
- authorization_url?: string | undefined;
73
72
  issuer?: string | undefined;
73
+ authorization_url?: string | undefined;
74
74
  token_param_name?: string | undefined;
75
75
  registration_url?: string | undefined;
76
76
  }, {
@@ -81,8 +81,8 @@ declare const localAgentSchema: z.ZodObject<{
81
81
  redirect_uri?: string | undefined;
82
82
  token_url?: string | undefined;
83
83
  audiences?: string[] | undefined;
84
- authorization_url?: string | undefined;
85
84
  issuer?: string | undefined;
85
+ authorization_url?: string | undefined;
86
86
  token_param_name?: string | undefined;
87
87
  registration_url?: string | undefined;
88
88
  }>]>>;
@@ -108,8 +108,8 @@ declare const localAgentSchema: z.ZodObject<{
108
108
  redirect_uri?: string | undefined;
109
109
  token_url?: string | undefined;
110
110
  audiences?: string[] | undefined;
111
- authorization_url?: string | undefined;
112
111
  issuer?: string | undefined;
112
+ authorization_url?: string | undefined;
113
113
  token_param_name?: string | undefined;
114
114
  registration_url?: string | undefined;
115
115
  } | undefined;
@@ -139,8 +139,8 @@ declare const localAgentSchema: z.ZodObject<{
139
139
  redirect_uri?: string | undefined;
140
140
  token_url?: string | undefined;
141
141
  audiences?: string[] | undefined;
142
- authorization_url?: string | undefined;
143
142
  issuer?: string | undefined;
143
+ authorization_url?: string | undefined;
144
144
  token_param_name?: string | undefined;
145
145
  registration_url?: string | undefined;
146
146
  } | undefined;
@@ -183,8 +183,8 @@ declare const localAgentSchema: z.ZodObject<{
183
183
  redirect_uri?: string | undefined;
184
184
  token_url?: string | undefined;
185
185
  audiences?: string[] | undefined;
186
- authorization_url?: string | undefined;
187
186
  issuer?: string | undefined;
187
+ authorization_url?: string | undefined;
188
188
  token_param_name?: string | undefined;
189
189
  registration_url?: string | undefined;
190
190
  } | undefined;
@@ -225,8 +225,8 @@ declare const localAgentSchema: z.ZodObject<{
225
225
  redirect_uri?: string | undefined;
226
226
  token_url?: string | undefined;
227
227
  audiences?: string[] | undefined;
228
- authorization_url?: string | undefined;
229
228
  issuer?: string | undefined;
229
+ authorization_url?: string | undefined;
230
230
  token_param_name?: string | undefined;
231
231
  registration_url?: string | undefined;
232
232
  } | undefined;
@@ -308,8 +308,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
308
308
  redirect_uri?: string | undefined;
309
309
  token_url?: string | undefined;
310
310
  audiences?: string[] | undefined;
311
- authorization_url?: string | undefined;
312
311
  issuer?: string | undefined;
312
+ authorization_url?: string | undefined;
313
313
  token_param_name?: string | undefined;
314
314
  registration_url?: string | undefined;
315
315
  }, {
@@ -320,8 +320,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
320
320
  redirect_uri?: string | undefined;
321
321
  token_url?: string | undefined;
322
322
  audiences?: string[] | undefined;
323
- authorization_url?: string | undefined;
324
323
  issuer?: string | undefined;
324
+ authorization_url?: string | undefined;
325
325
  token_param_name?: string | undefined;
326
326
  registration_url?: string | undefined;
327
327
  }>]>, {
@@ -346,8 +346,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
346
346
  redirect_uri?: string | undefined;
347
347
  token_url?: string | undefined;
348
348
  audiences?: string[] | undefined;
349
- authorization_url?: string | undefined;
350
349
  issuer?: string | undefined;
350
+ authorization_url?: string | undefined;
351
351
  token_param_name?: string | undefined;
352
352
  registration_url?: string | undefined;
353
353
  }, {
@@ -372,8 +372,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
372
372
  redirect_uri?: string | undefined;
373
373
  token_url?: string | undefined;
374
374
  audiences?: string[] | undefined;
375
- authorization_url?: string | undefined;
376
375
  issuer?: string | undefined;
376
+ authorization_url?: string | undefined;
377
377
  token_param_name?: string | undefined;
378
378
  registration_url?: string | undefined;
379
379
  }>>;
@@ -407,8 +407,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
407
407
  redirect_uri?: string | undefined;
408
408
  token_url?: string | undefined;
409
409
  audiences?: string[] | undefined;
410
- authorization_url?: string | undefined;
411
410
  issuer?: string | undefined;
411
+ authorization_url?: string | undefined;
412
412
  token_param_name?: string | undefined;
413
413
  registration_url?: string | undefined;
414
414
  } | undefined;
@@ -441,8 +441,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
441
441
  redirect_uri?: string | undefined;
442
442
  token_url?: string | undefined;
443
443
  audiences?: string[] | undefined;
444
- authorization_url?: string | undefined;
445
444
  issuer?: string | undefined;
445
+ authorization_url?: string | undefined;
446
446
  token_param_name?: string | undefined;
447
447
  registration_url?: string | undefined;
448
448
  } | undefined;
@@ -515,8 +515,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
515
515
  redirect_uri?: string | undefined;
516
516
  token_url?: string | undefined;
517
517
  audiences?: string[] | undefined;
518
- authorization_url?: string | undefined;
519
518
  issuer?: string | undefined;
519
+ authorization_url?: string | undefined;
520
520
  token_param_name?: string | undefined;
521
521
  registration_url?: string | undefined;
522
522
  }, {
@@ -527,8 +527,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
527
527
  redirect_uri?: string | undefined;
528
528
  token_url?: string | undefined;
529
529
  audiences?: string[] | undefined;
530
- authorization_url?: string | undefined;
531
530
  issuer?: string | undefined;
531
+ authorization_url?: string | undefined;
532
532
  token_param_name?: string | undefined;
533
533
  registration_url?: string | undefined;
534
534
  }>]>, {
@@ -553,8 +553,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
553
553
  redirect_uri?: string | undefined;
554
554
  token_url?: string | undefined;
555
555
  audiences?: string[] | undefined;
556
- authorization_url?: string | undefined;
557
556
  issuer?: string | undefined;
557
+ authorization_url?: string | undefined;
558
558
  token_param_name?: string | undefined;
559
559
  registration_url?: string | undefined;
560
560
  }, {
@@ -579,8 +579,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
579
579
  redirect_uri?: string | undefined;
580
580
  token_url?: string | undefined;
581
581
  audiences?: string[] | undefined;
582
- authorization_url?: string | undefined;
583
582
  issuer?: string | undefined;
583
+ authorization_url?: string | undefined;
584
584
  token_param_name?: string | undefined;
585
585
  registration_url?: string | undefined;
586
586
  }>>;
@@ -614,8 +614,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
614
614
  redirect_uri?: string | undefined;
615
615
  token_url?: string | undefined;
616
616
  audiences?: string[] | undefined;
617
- authorization_url?: string | undefined;
618
617
  issuer?: string | undefined;
618
+ authorization_url?: string | undefined;
619
619
  token_param_name?: string | undefined;
620
620
  registration_url?: string | undefined;
621
621
  } | undefined;
@@ -648,8 +648,8 @@ declare const remoteAgentSchema: z.ZodUnion<[z.ZodObject<{
648
648
  redirect_uri?: string | undefined;
649
649
  token_url?: string | undefined;
650
650
  audiences?: string[] | undefined;
651
- authorization_url?: string | undefined;
652
651
  issuer?: string | undefined;
652
+ authorization_url?: string | undefined;
653
653
  token_param_name?: string | undefined;
654
654
  registration_url?: string | undefined;
655
655
  } | undefined;
@@ -3,5 +3,5 @@
3
3
  * Copyright 2026 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- export declare const GIT_COMMIT_INFO = "a41ce0f59";
7
- export declare const CLI_VERSION = "0.55.0";
6
+ export declare const GIT_COMMIT_INFO = "58ba19945";
7
+ export declare const CLI_VERSION = "0.55.1";
@@ -5,6 +5,6 @@
5
5
  */
6
6
  // This file is auto-generated by the build script (scripts/generate-git-commit-info.js)
7
7
  // Do not edit this file manually.
8
- export const GIT_COMMIT_INFO = 'a41ce0f59';
9
- export const CLI_VERSION = '0.55.0';
8
+ export const GIT_COMMIT_INFO = '58ba19945';
9
+ export const CLI_VERSION = '0.55.1';
10
10
  //# sourceMappingURL=git-commit.js.map
@@ -12,7 +12,7 @@ import { OAuthUtils, ResourceMismatchError } from './oauth-utils.js';
12
12
  import { coreEvents } from '../utils/events.js';
13
13
  import { debugLogger } from '../utils/debugLogger.js';
14
14
  import { getConsentForOauth } from '../utils/authConsent.js';
15
- import { generatePKCEParams, startCallbackServer, getPortFromUrl, buildAuthorizationUrl, exchangeCodeForToken, refreshAccessToken as refreshAccessTokenShared, REDIRECT_PATH, } from '../utils/oauth-flow.js';
15
+ import { generatePKCEParams, startCallbackServer, getPortFromUrl, buildAuthorizationUrl, exchangeCodeForToken, refreshAccessToken as refreshAccessTokenShared, getRedirectUri, } from '../utils/oauth-flow.js';
16
16
  /**
17
17
  * Provider for handling OAuth authentication for MCP servers.
18
18
  */
@@ -30,7 +30,7 @@ export class MCPOAuthProvider {
30
30
  * @returns The registered client information
31
31
  */
32
32
  async registerClient(registrationUrl, config, redirectPort) {
33
- const redirectUri = config.redirectUri || `http://localhost:${redirectPort}${REDIRECT_PATH}`;
33
+ const redirectUri = getRedirectUri(config, redirectPort);
34
34
  const registrationRequest = {
35
35
  client_name: 'Gemini CLI MCP Client',
36
36
  redirect_uris: [redirectUri],
@@ -365,11 +365,14 @@ ${authUrl}
365
365
  debugLogger.debug(`Returning valid token for server: ${serverName}`);
366
366
  return token.accessToken;
367
367
  }
368
- // Try to refresh if we have a refresh token
369
- if (token.refreshToken && config.clientId && credentials.tokenUrl) {
368
+ // Try to refresh if we have a refresh token. Fall back to the client ID
369
+ // persisted during dynamic client registration when the static config
370
+ // does not provide one.
371
+ const clientId = config.clientId ?? credentials.clientId;
372
+ if (token.refreshToken && clientId && credentials.tokenUrl) {
370
373
  try {
371
374
  debugLogger.log(`Refreshing expired token for MCP server: ${serverName}`);
372
- const newTokenResponse = await this.refreshAccessToken(config, token.refreshToken, credentials.tokenUrl, credentials.mcpServerUrl);
375
+ const newTokenResponse = await this.refreshAccessToken({ ...config, clientId }, token.refreshToken, credentials.tokenUrl, credentials.mcpServerUrl);
373
376
  // Update stored token
374
377
  const newToken = {
375
378
  accessToken: newTokenResponse.access_token,
@@ -380,7 +383,7 @@ ${authUrl}
380
383
  if (newTokenResponse.expires_in) {
381
384
  newToken.expiresAt = Date.now() + newTokenResponse.expires_in * 1000;
382
385
  }
383
- await this.tokenStorage.saveToken(serverName, newToken, config.clientId, credentials.tokenUrl, credentials.mcpServerUrl);
386
+ await this.tokenStorage.saveToken(serverName, newToken, clientId, credentials.tokenUrl, credentials.mcpServerUrl);
384
387
  return newToken.accessToken;
385
388
  }
386
389
  catch (error) {
@@ -400,7 +403,7 @@ ${authUrl}
400
403
  const clientId = config.clientId ?? credentials.clientId;
401
404
  if (current.refreshToken && clientId && credentials.tokenUrl) {
402
405
  try {
403
- const newTokenResponse = await this.refreshAccessToken(config, current.refreshToken, credentials.tokenUrl, credentials.mcpServerUrl);
406
+ const newTokenResponse = await this.refreshAccessToken({ ...config, clientId }, current.refreshToken, credentials.tokenUrl, credentials.mcpServerUrl);
404
407
  const refreshed = {
405
408
  accessToken: newTokenResponse.access_token,
406
409
  tokenType: newTokenResponse.token_type,