Home

mweinbach / agent-coworker

publicmweinbach/agent-coworker
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Refactor Google provider runtime and sync desktop/TUI tooling (#50)

7 months ago

1ff6a2b
Authored
Max Weinbach3/19/2026, 10:29:51 PM
* feat: decouple Google provider from PI runtime into Google Interactions API

Introduces a new `google-interactions` runtime that calls the Google
Gemini Interactions API directly via the `@google/genai` SDK, mirroring
how the OpenAI provider uses its own Responses API runtime.

Key changes:
- New runtime files: googleInteractionsModel.ts, googleNativeInteractions.ts,
  googleInteractionsRuntime.ts
- Added `google-interactions` to RUNTIME_NAMES and routing
- Google provider now routes to google-interactions runtime by default
- Removed Google-specific code from PI runtime (resolvePiModel, buildPiStreamOptions)
- Updated server protocol and client replay to handle new format

https://claude.ai/code/session_01WTb2HpoqFgBiENyX7w7QHC

* test: add Google Interactions runtime tests and Gemini 3.1 model configs

- Add 17 unit tests for the new Google Interactions runtime
- Add gemini-3.1-pro-preview and gemini-3.1-pro-preview-customtools models
- Update runtime selection tests for Google → google-interactions routing
- Update PI options test (Google no longer mapped through PI)

https://claude.ai/code/session_01WTb2HpoqFgBiENyX7w7QHC

* Fix Google interactions replay and desktop transcript dedupe

* Preserve raw Exa search citations across overflow hydration

* Update Gemini models and cancel child agents with parent turns

* fix: preserve LM Studio history and desktop dev imports

* Add subagent-aware cancel controls and preserve Google tool results

* Fix Google interaction turn boundaries and native tool gating

* Fix Google continuation state and remove Maps support

* fix preserve google replay signatures and tool history

* google fixes

* Preserve resumed thread providers during desktop reconnects

* fix: harden cross-platform skills and slide workflows

* Fix workspace settings sync and cover handshake races

* Fix idle subagent cancel and URL context result normalization

* Fix agent cancel and reasoning replay state handling

* fix: harden google continuation recovery and reasoning dedupe

* fix: address google runtime review follow-ups

* fix: stabilize google tool ids across replay

* Preserve native Google tool history in interaction transcripts

* fix mapping

* Preserve resumed child model defaults on desktop reconnect

Parentf87fd5f

130 files changed
  • .agents/skills/gemini-interactions-api/SKILL.md+283−0
  • .factory/settings.json+5−0
  • apps/TUI/app.tsx+7−0
  • apps/TUI/component/dialog-command.tsx+9−0
  • apps/TUI/component/message/tool-part.tsx+8−1
  • apps/TUI/component/prompt/slash-commands.ts+10−1
  • apps/TUI/component/tool/web.tsx+8−0
  • apps/TUI/context/sync.tsx+6
−2
  • apps/TUI/context/syncTypes.ts+1−1
  • apps/desktop/index.html+0−6
  • apps/desktop/src/app/openaiCompatibleProviderOptions.ts+37−0
  • apps/desktop/src/app/store.actions/thread.ts+7−2
  • apps/desktop/src/app/store.actions/workspace.ts+2−0
  • apps/desktop/src/app/store.actions/workspaceDefaults.ts+42−20
  • apps/desktop/src/app/store.feedMapping.ts+66−7
  • apps/desktop/src/app/store.helpers.ts+4−3
  • apps/desktop/src/app/store.helpers/controlSocket.ts+48−0
  • apps/desktop/src/app/store.helpers/runtimeState.ts+4−0
  • apps/desktop/src/app/store.helpers/threadEventReducer.ts+6−3
  • apps/desktop/src/lib/desktopSchemas.ts+15−0
  • apps/desktop/src/lib/reactGrabDevTools.ts+21−0
  • apps/desktop/src/main.tsx+3−0
  • apps/desktop/src/ui/ChatView.tsx+117−21
  • apps/desktop/src/ui/chat/toolCards/toolCardFormatting.ts+71−8
  • apps/desktop/src/ui/settings/pages/WorkspacesPage.tsx+162−4
  • apps/desktop/test/chat-reasoning-ui.test.ts+35−0
  • apps/desktop/test/chat-view.stability.test.tsx+51−1
  • apps/desktop/test/developer-page.test.tsx+13−1
  • apps/desktop/test/modelChoices.test.ts+1−1
  • apps/desktop/test/onboarding-ui.test.tsx+14−1
  • apps/desktop/test/onboarding.test.ts+2−1
  • apps/desktop/test/protocol-v2-events.test.ts+110−0
  • apps/desktop/test/react-grab-dev-tools.test.ts+31−0
  • apps/desktop/test/store-feed-mapping.test.ts+776−0
  • apps/desktop/test/thread-reconnect.test.ts+125−1
  • apps/desktop/test/tool-card-formatting.test.ts+12−0
  • apps/desktop/test/workspace-settings-sync.test.ts+69−2
  • apps/desktop/test/workspace-startup.test.ts+1−0
  • apps/desktop/test/workspaces-page.test.ts+51−1
  • bun.lock+7−4
  • config/models/google/gemini-3-flash-preview.json+1−2
  • config/models/google/gemini-3-pro-preview.json+0−15
  • config/models/google/gemini-3.1-flash-lite-preview.json+14−0
  • config/models/google/gemini-3.1-pro-preview-customtools.json+14−0
  • config/models/google/gemini-3.1-pro-preview.json+14−0
  • docs/architecture.md+4−3
  • docs/websocket-protocol.md+37−5
  • package.json+1−0
  • prompts/system-models/claude-haiku-4-5.md+2−0
  • prompts/system-models/claude-opus-4-6.md+2−0
  • prompts/system-models/claude-sonnet-4-6.md+2−0
  • prompts/system-models/gemini-3-flash-preview.md+3−1
  • prompts/system-models/gemini-3-pro-preview.md+0−685
  • prompts/system-models/gemini-3.1-pro-preview.md+511−188
  • prompts/system-models/gpt-5.2.md+3−1
  • prompts/system-models/gpt-5.4.md+3−1
  • prompts/system.md+3−1
  • scripts/run_raw_agent_loops.ts+2−2
  • skills-lock.json+5−0
  • skills/slides/SKILL.md+12−7
  • skills/slides/scripts/detect_font.py+13−4
  • skills/slides/scripts/ensure_raster_image.py+24−8
  • skills/slides/scripts/executable_resolution.py+304−0
  • skills/slides/scripts/render_slides.py+10−4
  • src/agent.ts+4−4
  • src/client/modelStreamReplay.ts+99−21
  • src/models/childAgentModelInfo.ts+3−1
  • src/models/registry.ts+6−2
  • src/prompt.ts+41−0
  • src/providers/google.ts+0−1
  • src/providers/googleReplay.ts+6−1
  • src/runtime/googleInteractionsModel.ts+94−0
  • src/runtime/googleInteractionsRuntime.ts+317−0
  • src/runtime/googleNativeInteractions.ts+1226−0
  • src/runtime/index.ts+6−0
  • src/runtime/openaiResponsesRuntime.ts+3−1
  • src/runtime/piRuntime.ts+3−8
  • src/runtime/piRuntimeOptions.ts+1−17
  • src/runtime/types.ts+4−4
  • src/server/agents/AgentControl.ts+13−0
  • src/server/modelStream.ts+1−1
  • src/server/protocol.ts+2−2
  • src/server/protocolEventParser.ts+14−0
  • src/server/protocolParser.ts+43−14
  • src/server/session/AgentSession.ts+6−2
  • src/server/session/ProviderAuthManager.ts+5−5
  • src/server/session/SessionContext.ts+4−3
  • src/server/session/SessionMetadataManager.ts+14−1
  • src/server/session/TurnExecutionManager.ts+40−5
  • src/server/sessionDb.ts+3−3
  • src/server/sessionDb/mappers.ts+2−2
  • src/server/sessionDb/repository.ts+1−1
  • src/server/sessionStore.ts+14−11
  • src/server/startServer.ts+6−7
  • src/server/startServer/dispatchClientMessage.ts+1−1
  • src/session/pricing.ts+15−15
  • src/shared/displayCitationMarkers.ts+129−18
  • src/shared/googleInteractionsStreamParts.ts+508−0
  • src/shared/googleThinking.ts+68−0
  • src/shared/openaiCompatibleOptions.ts+122−13
  • src/shared/openaiContinuation.ts+1−1
  • src/shared/providerContinuation.ts+53−0
  • src/tools/bash.ts+61−27
  • src/tools/index.ts+12−2
  • src/tools/webSearch.ts+22−22
  • src/types.ts+8−1
  • tasks/lessons.md+8−0
  • tasks/todo.md+84−0
  • test/agentControl.test.ts+32−0
  • test/config.test.ts+24−4
  • test/displayCitationMarkers.test.ts+251−0
  • test/modelStreamReplay.test.ts+257−0
  • test/prompt.test.ts+57−9
  • test/protocol.test.ts+44−1
  • test/providers/google.test.ts+14−11
  • test/providers/lmstudio.test.ts+3−3
  • test/repl.test.ts+2−2
  • test/runtime.google-interactions.test.ts+1639−0
  • test/runtime.pi-options.test.ts+5−8
  • test/runtime.pi-runtime.test.ts+139−1
  • test/runtime.selection.test.ts+24−1
  • test/server.test.ts+168−15
  • test/session.test.ts+198−11
  • test/session/pricing.test.ts+11−1
  • test/shared/googleInteractionsStreamParts.test.ts+237−0
  • test/shared/googleThinking.test.ts+41−0
  • test/shared/openaiCompatibleOptions.test.ts+51−2
  • test/slides-scripts.test.ts+137−0
  • test/tools.test.ts+168−14
  • test/utils.browser.test.ts+1−1