Skip to content

chore: merge upstream gemini-cli v0.29.7 & v0.30.0#31

Open
kuishou68 wants to merge 924 commits intomainfrom
merge-upstream-latest
Open

chore: merge upstream gemini-cli v0.29.7 & v0.30.0#31
kuishou68 wants to merge 924 commits intomainfrom
merge-upstream-latest

Conversation

@kuishou68
Copy link
Collaborator

Summary

  • Merge upstream google-gemini/gemini-cli v0.29.7 and v0.30.0 (141 commits) into aioncli
  • Add LlmRole parameter to all custom ContentGenerator adapters (OpenAI, Anthropic, Bedrock) to match the updated interface
  • Fix non-interactive auth: environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY, etc.) now take priority over stored Google OAuth settings
  • Add ANTHROPIC_API_KEY detection and validation in the auth flow

Key upstream changes (v0.30.0)

  • LlmRole parameter added to generateContent / generateContentStream interface
  • supportsModernFeatures() replaces isPreviewModel() for model detection
  • isCustomModel() function for non-Gemini model identification
  • getAuthTypeFromEnv() moved to core (kept our extended version in CLI with Bedrock/OpenAI/Anthropic support)
  • allowPlanMode replaces isPlanEnabled in approval mode cycling
  • New rewind feature, plan mode, background shells, and more UI improvements

Conflict resolution strategy

65 files had changes from both sides. Key resolutions:

File Our change Upstream change Resolution
contentGenerator.ts USE_OPENAI/ANTHROPIC/BEDROCK enums, extended ContentGeneratorConfig LlmRole param, getAuthTypeFromEnv() Both preserved
baseLlmClient.ts generateJsonForOpenAI() (~120 lines) role: LlmRole threading Both preserved, OpenAI branch also passes role
validateNonInterActiveAuth.ts Bedrock/OpenAI env detection in local getAuthTypeFromEnv() Deleted local function, imported from core Kept local extended version (core version only has Google types)
models.ts Bedrock model region definitions isCustomModel(), supportsModernFeatures() Both preserved (different locations)
package.json @office-ai/aioncli-core name, openai/@anthropic-ai/sdk/@aws-sdk deps Version bump to 0.30.0, OpenTelemetry upgrades Both preserved

Test results

  • DeepSeek (OpenAI-compatible): conversation works
  • OpenRouter (free model): conversation works
  • Gemini API Key: path correct (key expired, not code issue)
  • Anthropic: path routes to AnthropicContentGenerator correctly
  • Tool calling (DeepSeek + shell): model invokes tools correctly
  • Unit tests: OpenAI adapter 52/52, Auth validation 17/17, Auth config 8/8
  • Core tests: 4875/4909 passed (34 failures are pre-existing upstream issues in oauth2, tokenLimits, turn, mcp-client, shell)

Test plan

  • npm run build passes
  • OpenAI adapter unit tests (52/52)
  • Auth validation unit tests (17/17)
  • Live API test: DeepSeek via OPENAI_API_KEY
  • Live API test: OpenRouter via OPENAI_API_KEY
  • Live API test: Anthropic via ANTHROPIC_API_KEY
  • Tool calling works with OpenAI-compatible API
  • AionUi file: link integration compiles (0 TS errors after adaptation)

Generated with Claude Code

NTaylorMullen and others added 30 commits February 8, 2026 01:57
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com>
gemini-cli-robot and others added 28 commits February 19, 2026 15:36
…ing (google-gemini#125)

* feat(core,ui): support Gemini 3.1 Pro Preview and active model filtering

* fix(core,ui): use optional chaining for config methods to support mocks

* fix(core): clear stale authType in refreshAuth to avoid incorrect model resolution

* do not show gemini 3.1 model when users do not have access to gemini 3.1 in stats
…ing (google-gemini#125)

* feat(core,ui): support Gemini 3.1 Pro Preview and active model filtering

* fix(core,ui): use optional chaining for config methods to support mocks

* fix(core): clear stale authType in refreshAuth to avoid incorrect model resolution

* do not show gemini 3.1 model when users do not have access to gemini 3.1 in stats
* feat(models): add support for Gemini 3.1 and custom tool models

* test(routing): fix classifier and numerical classifier strategy tests

* test(routing): add Gemini 3.1 tests for classifier strategy

* fix(models): correctly filter active Gemini 3.1 models

* fix(routing): ensure useCustomToolModel is only true when Gemini 3.1 is enabled

* fix(test-utils): prevent double newline in lastFrame() on Windows

* fix(test-utils): surgically fix double newline in lastFrame() on Windows

* use custom_tools_model string for api key only

* fix(ui): correct useCustomToolModel logic and update tests

* fix(ui): correct useCustomToolModel logic in StatsDisplay

* fix(routing): ensure test models are active and sync useCustomToolModel logic
* only use customtoolmodel for api key users

* use displaystring for showing model in about
* feat(models): add support for Gemini 3.1 and custom tool models

* test(routing): fix classifier and numerical classifier strategy tests

* test(routing): add Gemini 3.1 tests for classifier strategy

* fix(models): correctly filter active Gemini 3.1 models

* fix(routing): ensure useCustomToolModel is only true when Gemini 3.1 is enabled

* fix(test-utils): prevent double newline in lastFrame() on Windows

* fix(test-utils): surgically fix double newline in lastFrame() on Windows

* use custom_tools_model string for api key only

* fix(ui): correct useCustomToolModel logic and update tests

* fix(ui): correct useCustomToolModel logic in StatsDisplay

* fix(routing): ensure test models are active and sync useCustomToolModel logic
* only use customtoolmodel for api key users

* use displaystring for showing model in about
… to patch version v0.30.0-preview.3 and create version 0.30.0-preview.4 (google-gemini#20040)

Co-authored-by: Sehoon Shon <sshon@google.com>
… to patch version v0.30.0-preview.4 and create version 0.30.0-preview.5 (google-gemini#20086)

Co-authored-by: Sandy Tao <sandytao520@icloud.com>
…version v0.29.6 and create version 0.29.7 (google-gemini#20111)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
… to patch version v0.30.0-preview.5 and create version 0.30.0-preview.6 (google-gemini#20112)

Co-authored-by: Bryan Morgan <bryanmorgan@google.com>
Merge upstream google-gemini/gemini-cli v0.29.7 into aioncli.

Key changes incorporated:
- PromptProvider class refactoring (extracted from inline prompts)
- HookSystem replacing messageBus-based hooks
- AcknowledgedAgentsService for agent management
- Updated dependencies across all packages

Protected aioncli modifications preserved:
- OpenAI adapter (openaiContentGenerator.ts)
- Multi-model token limits (tokenLimits.ts)
- Bedrock model definitions (models.ts)
- Custom package identity (@office-ai/aioncli-core)
- API key rotation logic in fallback handler
Merge upstream google-gemini/gemini-cli v0.30.0 into aioncli (141 commits).

Key changes from v0.30.0:
- LlmRole parameter added to generateContent/generateContentStream
- supportsModernFeatures() replaces isPreviewModel() for model detection
- isCustomModel() function for non-Gemini model identification
- GEMINI_CLI env var identification for MCP server transports
- getAuthTypeFromEnv() moved to core (kept our extended version in CLI)
- Improved model-not-found error messages (VALID_GEMINI_MODELS check)
- allowPlanMode replaces isPlanEnabled in approval mode cycling

Protected aioncli modifications preserved:
- OpenAI adapter (openaiContentGenerator.ts)
- Multi-model token limits (tokenLimits.ts)
- Bedrock model definitions (models.ts)
- Custom package identity (@office-ai/aioncli-core)
- Extended getAuthTypeFromEnv with Bedrock/OpenAI detection
- baseLlmClient.ts generateJsonForOpenAI with LlmRole support
Upstream v0.30.0 added a `role: LlmRole` third parameter to the
ContentGenerator interface's generateContent/generateContentStream
methods. Our three custom adapters (OpenAI, Bedrock, Anthropic) were
missing this parameter. While TypeScript allows fewer params in
implementations, this fix ensures interface conformance and consistency.

Also fixes OpenRouter header test to match aioncli branding values.

Note: Pre-existing ESLint no-unsafe-type-assertion warnings in adapter
files are deferred - they predate this change and require a separate
cleanup effort.
…del auth

When OPENAI_API_KEY, ANTHROPIC_API_KEY, or AWS credentials are set via
environment variables, they now take priority over the stored Google OAuth
selectedType in non-interactive mode. This fixes the issue where users
with cached Google OAuth credentials could not use alternate providers
via env vars without first clearing their settings.

Also adds ANTHROPIC_API_KEY detection and validation in the non-interactive
auth flow, completing the multi-model auth support.
Update aioncli-analysis.md with detailed two-sided comparison tables
for all 6 key conflict files resolved during the v0.29.7 and v0.30.0
upstream merges, plus post-merge fix documentation.

Also fix unhandled 'exit' ShellOutputEvent in shell.ts.
@kuishou68 kuishou68 force-pushed the merge-upstream-latest branch from ab76144 to 2b8e763 Compare February 27, 2026 11:44
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.