Skip to content

WIP: upgrade gemini-cli to v0.37.1 + multimodal & model switching#7

Draft
e-mon wants to merge 4 commits into
mainfrom
feat/upgrade-gemini-cli-0.35.1
Draft

WIP: upgrade gemini-cli to v0.37.1 + multimodal & model switching#7
e-mon wants to merge 4 commits into
mainfrom
feat/upgrade-gemini-cli-0.35.1

Conversation

@e-mon

@e-mon e-mon commented Mar 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Upgrade @google/gemini-cli from 0.34.0-nightly.20260307 to 0.35.1 stable
  • Fix [UX] Users are not notified when a long-running task completes because Discord ignores edits #6: Discord progress message always deleted instead of edit-finalize (no push notification on edits)
  • Fix Docker sandbox networking: v0.35.0 defaults networkAccess to false, breaking OAuth and API calls (google-gemini/gemini-cli#23875)
  • Multimodal ACP prompts: images/audio sent inline as base64, eliminating tool call overhead
  • Dynamic model switching: geminiclaw_switch_model admin tool via unstable_setSessionModel
  • Session info: parse available models/modes from session/new response

Patch changes

  • Patch 2 (sub-agent MCP tool registration throw) removed — resolved upstream
  • Patches 1,3,4,5 recreated for new dist/src/ split file structure
  • Patch 1: varlet (split files resolve scoping issue)

Breaking change adaptations

  • assertSandboxPatchApplied: path resolution updated for dist/src/gemini.js
  • activate_skill matching: endsWith('_activate_skill') for MCP FQN prefix
  • Docker sandbox networkAccess: v0.35.0 introduced --internal network isolation by default, which blocks all external traffic including Gemini API and OAuth. This is an upstream bug (google-gemini/gemini-cli#23875). Workaround: set tools.sandbox.networkAccess=true in .gemini/settings.json via ensureGeminiSettings().

Test plan

  • bun run build passes
  • bun vitest run — 551 tests pass
  • All 4 patches verified applied
  • Manual: task start → ACP connection + streaming response
  • Manual: Docker sandbox with OAuth token refresh
  • Manual: image attachment from Discord → inline multimodal processing
  • Manual: geminiclaw_switch_model tool invocation

🤖 Generated with Claude Code

e-mon and others added 4 commits March 26, 2026 16:21
Discord does not send push notifications for message edits, so editing
the progress message into the final reply left users unnotified for
long-running tasks. Always delete and repost instead.

Closes #6

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Upgrade from 0.34.0-nightly to 0.35.1 stable with patch reduction
(5 → 4, patch 2 resolved upstream) and three new features:

- Multimodal ACP prompts: images/audio sent inline as base64 prompt
  parts instead of @filepath references, eliminating tool call overhead
- Dynamic model switching: unstable_setSessionModel ACP method exposed
  via geminiclaw_switch_model admin tool for mid-session model changes
- Session info: parse available models/modes from session/new response

Breaking change adaptations:
- Package structure: bundle/gemini.js → dist/src/ split files
- assertSandboxPatchApplied: simplified path resolution + full read
- MCP tool FQN: activate_skill matching uses endsWith for mcp_ prefix
- Patch 1: var → let (split files resolve scoping issue)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Gemini CLI v0.35.0 introduced network isolation for Docker sandbox
(--internal flag on custom network). This blocks OAuth token exchange
and MCP HTTP server access, causing EAI_AGAIN DNS failures.

Set tools.sandbox.networkAccess=true in .gemini/settings.json when
Docker sandbox is active to restore external network access.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Bump @google/gemini-cli 0.35.1 → 0.37.1 with patch recreation for the
new bundle/gemini.js single-file layout (v0.37+ re-bundles dist/src/*).

Patch changes:
- Patches 1,3,4,5 recreated against bundle/gemini.js (was dist/src/)
- Patch 1 (usageMetadata) now coexists with upstream's native _meta.quota
  while preserving thoughtsTokenCount and cachedContentTokenCount tracking
- Patch 2 (sub-agent MCP tool registration) stays resolved upstream

GeminiClaw-side fixes:
- assertSandboxPatchApplied: target path updated for bundle/ layout
- Remove unused `join` import from node:path
- Revert d1b597a networkAccess workaround (fixed upstream via #24055,
  cherry-picked into v0.35.3+, default is now networkAccess=true)
- Exclude Playwright integration test from default vitest suite
  (requires browser binaries, flaky under concurrent test load)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@e-mon e-mon changed the title WIP: upgrade gemini-cli to v0.35.1 + multimodal & model switching WIP: upgrade gemini-cli to v0.37.1 + multimodal & model switching Apr 12, 2026

@GitHatake GitHatake left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry, I approved by mistake! Please ignore my approval.

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.

[UX] Users are not notified when a long-running task completes because Discord ignores edits

2 participants