Epic: support Gemini 4 Argon via native Google GenerateContent
维护者通常 1 天内回复
@aheritier 已经在做这个了。
开始于 2026年10月16日。
评估
调研方向
This is a design epic, and the body states that no implementation is authorized yet. Start with the P1 slice: thinking-level detection in modelinfo and the Gemini buildConfig path in the Go provider, plus the embedded models.dev snapshot. Done means a maintainer has opened and scoped a child PR for P1, and the Argon thinking and catalog regressions pass. Do not start P2 or P3 until P1 is merged.
由索引模型根据 Issue 内容生成。
描述
🤖 Automated architect agent — this comment was posted by the architect bot from Docker Agentic Platform, not by a human engineer
Overview
Recommendation: extend the existing native google / GenerateContent integration for gemini-4-argon; deliver reliable standard use before opt-in long decode. Do not add a provider, migrate to Interactions, or change the default Google model.
This is the single tracking epic and design for future implementation, published at Arnaud Héritier's request. No child issues, implementation, source edits, commits, PRs, paid inference, or merge are authorized by this publication. All implementation checkboxes below remain open.
Evidence baseline: 15 October 2026; repository main d32e27a3ce5a28e36b6cdc0f00b14e373a08e805. Source assessment/provenance were read in full; publication checkout matches this SHA and is clean. Code links below are immutable. External documentation/catalog facts reflect that dated source assessment, not a live paid-model test.
Navigation: Motivation · Contract · Current state · Design · P1 · P2 · P3 · Validation · Limitations · Evidence
Motivation
The configured model string already reaches GenerateContentStream, but routability is not full support: explicit thinking uses the wrong contract, the offline catalog predates launch, idle handling is too short, terminal outcomes are flattened, and SDK v1.71.0 lacks continuation. SDK auto-continuation also changes token semantics: repeated billed inputs must not inflate context occupancy and trigger premature compaction. C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, G4, G5, G6, S1, S2, S3
Use cases
- Ordinary streaming coding/reasoning agents with portable low/medium/high effort, signed sequential/parallel function calls, and correct cancellation/refusal handling on Developer API or Cloud.
- Offline discovery and multimodal inputs with accurate capabilities/context and clearly scoped token-price estimates.
- Explicitly spend-bounded long reasoning/output within one assistant turn, without duplicated text/tools, lost error outcomes, or incorrect billing/context gauges.
Dependency-ordered delivery checklist
- P1 — [no dependency] Standard requests, discovery, scoped idle policy, examples and existing-plumbing regressions.
- P2 — [depends on P1] Terminal outcomes plus billing/context separation, persistence and runtime consumers.
- P3 — [depends on P1 + P2] SDK v1.75.0 and explicit opt-in GenerateContent long decode.
These are proposed PR-sized slices, not opened PRs or child issues. P1 can improve ordinary use, but full support claims require P2 terminal semantics too. Do not enable/advertise automatic continuation before P2 accounting and terminal handling are in place. The default output ceiling must not become a million tokens. C6, C7, C8, C9, C10, G6, S2, S3
Contract and availability
| Area | Verified contract | Consequence |
|---|---|---|
| Public model | gemini-4-argon; stable/GA, 13 Oct 2026 |
Use this ID, no -preview suffix. |
| Developer API | Paid Gemini API / AI Studio; API key (x-goog-api-key); GenerateContent remains supported alongside Interactions |
Existing provider: google with GOOGLE_API_KEY or GEMINI_API_KEY is appropriate. API entitlement/billing must be enabled. A Gemini consumer subscription is not the API credential. |
| Google Cloud | Same ID; global, us, eu; Cloud guide supplies bearer-authenticated aiplatform.googleapis.com GenerateContent endpoint |
Existing project/location + ADC path is the relevant implementation. Long decode requires v1beta1, not v1; the Go SDK defaults to v1beta1 for BackendVertexAI. |
| Restricted variant | gemini-4-argon-cyber-permissive exists on Cloud but is restricted to Fairwind-approved projects |
Not the default/public example and not a substitute for entitlement. No separate docker-agent provider is needed merely for its name. |
| Modalities | Text/image/video/audio/PDF input; text output | Do not enable image generation, audio generation, or Live API. Existing attachment conversion is sufficient for ordinary uploaded inputs when capabilities resolve. |
| Context | 1,048,576 tokens shared by input, thinking, function calls and final output | Not a 1M input window plus an independent 1M output allowance. |
| Output | Default streaming/SDK single-hop cap 65,536; direct nonstreaming REST cap 32,768; long decode can use remaining space up to the unified limit | Keep ordinary explicit cap around 32,768–65,536. More than 65,536 is opt-in long decode, not an automatic default. |
| Thinking | LOW, MEDIUM (public default), HIGH; Cloud rejects thinking_budget and MINIMAL |
Use level-based controls and keep “unset” distinct from “off.” Thinking cannot be disabled by pretending an omitted config means none. |
| Sampling | temperature, top_p, top_k are ignored; Cloud rejects frequency_penalty, presence_penalty, candidate_count |
Avoid sending inert settings; fail clearly for incompatible explicit settings. Do not silently send numeric thinking budgets. |
| Cache | Implicit only. Developer docs: ≥4,096-token prefixes; Cloud docs: ≥6,144. 95% cache-hit input discount | Backend-specific thresholds, not a reason to implement explicit cache creation. |
| Tools | Function calling, structured outputs, Search, Maps, code execution, URL context, file search; computer use is preview | Existing common tools need regression tests, not a new engine. File search/computer use/dynamic video are optional feature projects. |
Sources: G2, G3, G4, G5, G6, G7, G8. The Developer GenerateContent troubleshooting text says legacy thinking budgets may be “ignored or mapped,” whereas Cloud explicitly rejects them. Use the common supported level contract; do not rely on the permissive wording for portable behavior.
Pricing and quota
Developer API standard pricing through 30 November 2026 is $2 input / $10 output / $0.10 cached input per million tokens; output includes thinking. From 1 December 2026, it becomes $4 / $20 / $0.20. Flex/Batch and Priority have different rates; built-in grounding can incur separate query charges. Do not present a token-only estimate as the complete invoice. Rate limits are project/model/tier dependent; use the customer's active limits, not a universal hardcoded RPM. G9, G10
The current docker-agent Gemini adapter does not populate chat.Usage.ServiceTier, and Cost.ForServiceTier only adjusts OpenAI models. Existing cost: overrides can represent a chosen fixed tier, but automatic accurate Gemini tier pricing is not established by simply setting provider_opts.service_tier. C15
Current state and gaps
Already usable foundations
- Native routing and auth:
client.goselects Developer API vsBackendVertexAI; accepts a direct key or Cloud ADC/explicit token source; supports the existing gateway. The request passesModelConfig.Modelverbatim. A custom transport wrapper without an explicit token source currently forces the documented Developer API fallback, so embedded/wrapped Cloud clients need their existing token-source path. Gateways may independently restrict model availability or request timeouts; none were live-tested. C1 - Tool exchange: native
FunctionCall.IDis preserved asToolCall.ProviderID, echoed intoFunctionResponse.ID, names are recovered, and parallel results are coalesced and sorted into original call order. This matches Argon's documented turn symmetry. C11, G8 - Thought signatures: the adapter forwards signature-only chunks; runtime and session persistence keep
ThoughtSignature; replay signs the first function call, with the documented skip-validation sentinel for history produced elsewhere. Google's GenerateContent guide explicitly says Gemini 4 and Gemini 3 share this basic rule: first function-call part is signed; all sequential steps in the current turn retain their signatures; a non-function-call response can sign its last part. G11, C11, C12 - Request features: configurable
max_tokens, structured JSON output, low/medium/high SDK constants, binary attachments, and built-ingoogle_search,google_maps,code_execution,url_contextalready exist. Mixed built-in/custom tools setIncludeServerSideToolInvocations. No explicit-cache create/reference path is used by Gemini requests. C2, C13, C14 - Escape hatches: existing
capabilities,cost,provider_opts.context_size,title_model,compaction_modelavoid needing a new config schema merely to recognize a model. C14, C16
Concrete gaps
A. Thinking control is not Argon-safe. UsesThinkingLevel claims Gemini 3+ but matches only gemini-3.... Setting thinking_budget: medium on Argon currently reaches the token-budget branch with the struct's token value, not thinkingLevel: MEDIUM. Non-title WithNoThinking sends thinkingBudget: 0 for an unrecognized Argon model. Merely broadening the predicate is insufficient: the Gemini-3 mapper accepts minimal, token fallback remains possible, and Google's TUI level map defaults to none, minimal, low, medium, high. none is normalized away by provider defaults, so it means server default, not disabled thinking. Local network-free detection also misses Argon. C2, C3
Recommendation: add a capability-oriented Argon family rule in modelinfo, recognize level-based behavior, use low/medium/high only for selectable levels, and reject unsupported explicit budgets/levels before network activity. Preserve unset as server default medium. Internal NoThinking should mean lowest supported effort (LOW) with no exposed thought summary, without silently enlarging an explicit caller cap. Keep previous Gemini behavior unchanged. Do not extrapolate Argon-only restrictions to every future Gemini model.
B. Catalog is stale offline, not necessarily online. Embedded snapshot date is 12 Oct 2026, with no Argon entry. Runtime can fetch/cache models.dev, and a read-only live fetch during this assessment does contain both google/gemini-4-argon and google-vertex/gemini-4-argon. Refresh the embedded snapshot for offline discovery, modalities, costs and context limits. A stale/missing entry can otherwise mean text-only attachment fallback, unknown context, and unknown prices. C4, C14, M1
Caution: live models.dev's google entry reports temperature: true and output 32768; its google-vertex entry reports temperature: false and output 65536. The first output value describes the nonstreaming REST cap rather than a universal stream limit, and the temperature flag conflicts with official ignored-parameter guidance. The schema's single Limit.Output cannot represent both a per-hop cap and a total continuation ceiling. Use official API behavior for protocol decisions, refresh via the generator, and do not make the catalog output field automatically enable million-token generation. Existing Gemini buildConfig uses explicit ModelConfig.MaxTokens, not the ModelOptions.MaxTokens catalog fallback; auxiliary cloning does copy an explicit option cap into the model config. C4, C17
C. Slow reasoning can hit the runtime idle watchdog. The default is 5 minutes, Gemini Flex 15 minutes. It resets on adapter-delivered responses, not necessarily every raw wire byte (despite the comment's wording). The shared HTTP client itself has no whole-request Timeout set. Official GenerateContent guidance says 20-minute read timeout. Add a scoped Argon 20-minute idle policy, retaining shorter explicit caller deadlines/cancellation and leaving other models unchanged. Reuse streamIdleTimeoutFor, including fallback execution, rather than a new global timeout framework. C5, G6
D. Finish reasons are flattened. The adapter currently discards finish-only/prompt-feedback-only responses and finishes as stop or tool_calls, not length/refusal. That can hide MAX_TOKENS, refusal or unfinished continuation. Runtime already has length/refusal handling, including voiding tool calls on refusal; wire it correctly. Terminal safety/length must take priority over earlier observed tools. A leaked CONTINUATION must never be reported as successful completion. C6, C18
E. SDK v1.71.0 cannot perform long decode. Both fetched v1.71.0 source and official minimum-version guidance establish the missing continuation support. v1.75.0 already provides GenerateContentStream continuation, retries/stop handling, cumulative hop usage and InitialPromptTokenCount(). Reuse it instead of implementing a parallel continuation engine. C7, S1, S2, S3
F. Long-decode accounting needs two meanings of input. Current flow is adapter Usage → runtime last cumulative snapshot → Session.SetUsage(prompt buckets, output) → compaction and context gauge. With SDK continuation, PromptTokenCount sums repeated input across hops: it is correct billed usage, not context length. Do not replace the billed count with initial prompt tokens or sum every streaming snapshot. C8, C9, C10, G6
Recommendation: add an optional, backward-compatible initial/context input count to chat.Usage (e.g. InitialInputTokens *int64, final name chosen consistently with existing naming), populated from SDK InitialPromptTokenCount() before serializing. Preserve all existing token buckets for cost, token-spend budgets and telemetry. Session context occupancy should use initial input + cumulative generated candidates/thoughts; legacy providers/messages fall back to current prompt buckets. Extend copying, JSON round-trips, events, resume/branch and compaction tests. An initial count is metadata for a response, not a value Usage.Add should blindly sum across independent turns. Explicitly retain this distinction in hooks/UI. C8, C9, C10, C19, S3
G. Auxiliary calls and nonstandard content need bounded checks. Title generation uses an explicit 128-token cap and a 30-second deadline; Gemini's title branch omits thinking config, leaving Argon's default medium reasoning. This is a potential empty-title/latency issue, not a live-reproduced failure. Rerank does not set thinkingBudget: 0; it replaces thinking config with IncludeThoughts:false, leaving default effort, and injects temperature 0 (ignored on Argon). Prefer an existing inexpensive title_model; keep explicit auxiliary caps and cancellation rather than raising every call to 32K. C20
The current single-signature message representation is adequate for the documented ordinary first-call-per-step convention; do not mandate a full rewrite for baseline Argon. Still test long-hop and built-in-tool raw parts. If fidelity tests establish a need to preserve multiple signed/ordered parts, reuse existing chat.ProviderState sealed raw-content replay, not a second persistence mechanism. Account for visible edits, model switches and compaction invalidating replay. C12, C21
Proposed design and alternatives
Recommended route: keep GenerateContent, ship in two stages
Standard support: direct Developer API and existing Cloud path; ordinary streaming text/tool turns within 65,536 tokens, documented limits, correct levels, metadata, terminal status and cancellation. Existing requests that leave thinking unset may already work with the server's medium default, but this does not cover the broken explicit controls or long pauses.
Full long decode: stay on GenerateContent with SDK v1.75.0; explicit max_tokens > 65536 opts into a larger total ceiling. Original request contents/system/tools stay unchanged across continuation hops. The SDK carries the continuation token; don't append partial output and prompt “continue.” Continuation is transport-level progress within one assistant turn, not another user message or extra tool execution.
- One unified 1,048,576-token window; only remaining space can be generated. Do not reserve independent 1M input/output windows or silently raise
max_tokensto 1M. - Preserve cancellation, finite stream-idle guard, maximum requested output, visible length/refusal results, and accurate partial usage on errors.
- Validate checkpoint retry behavior against the actual SDK. The upstream public loop yields chunks as they arrive; documentation prescribes pending/committed checkpoints on custom loops. Do not assert dropped-hop deduplication is proven by a version bump. A dropped stream before/after a checkpoint must not duplicate text or invoke tools twice. If a fixture exposes an SDK gap, address it upstream or with a narrow adapter boundary fix before advertising reconnect safety; do not build an independent broad retry system by default.
- Long outputs accumulate in runtime strings/session history. Include large synthetic streams, cancellation, persistence size/latency and TUI/API responsiveness in acceptance; no measured scale result is claimed here.
Alternatives and trade-offs
| Option | Decision |
|---|---|
| New Argon provider or OpenAI-compatible endpoint | Reject for primary support. Native Google plumbing already exists; OpenAI compatibility does not support long decode. |
| Interactions migration now | Defer. It offers server-side history and Developer API background execution, but brings stored state, interaction IDs, step/status/event replay, cancellation/resume, and backend differences. Cloud currently documents no Interactions long decode, while Developer API supports it. Not a contradiction when scoped to backend, and not necessary for this request. |
| Handwritten continuation loop | Reject initially. Existing Go SDK provides it. Handwritten checkpoints/usage/retries broaden risk and maintenance. |
| SDK bump alone | Insufficient: auto-continuation changes usage semantics and existing stop handling can conceal incomplete/refused results. Gate enablement on accounting/status tests. |
| Blanket future-generation behavior or global timeout increase | Reject. Recognize the verified family/capabilities and scope timeout behavior; avoid changing unrelated providers. |
Optional follow-ons, not baseline blockers: Interactions/background/resumable sessions; native file-search stores; preview computer use; dynamic/agentic video controls; full grounding citation/code-result rendering and exact per-part replay; automatic Gemini tier/grounding invoice estimation; batch workflows. No image/audio generation or Live feature should be promised for this text-output model.
PR-sized implementation plan and concrete acceptance criteria
P1 — [no dependency] Correct standard Argon requests and metadata
Likely files:
pkg/modelinfo/modelinfo.go,thinking_levels.goand corresponding tests;pkg/effort/effort.goonly if a distinct model-aware mapping is needed.pkg/model/provider/gemini/client.go,client_test.go,diagnostics*.goif validation categorization changes;pkg/model/provider/defaults.go/ factory boundary for preserving or rejecting explicit disabled budgets before normalization;pkg/runtime/model_switcher.gotests.pkg/runtime/streaming.go,stream_idle_timeout_test.go, existing fallback idle tests.pkg/modelsdev/snapshot.json,snapshot_date.txt,snapshot_test.goviatask update-models.docs/providers/google/index.md,docs/guides/thinking/index.md,agent-schema.jsondescriptive text,examples/gemini_4_argon.yaml.
Acceptance:
-
P1.1
gemini-4-argonuses native Google routing on API-key and Cloud ADC/token-source test transports. No default-model change. Cloud location examples useglobal(or verifiedus/eu), not an inheritedus-central1sample. Basis: C1, C16, G4, G5. -
P1.2 Omitted effort preserves default medium. Low/medium/high emit only
thinkingLevel; numeric budgets, unsupported explicit levels and incompatible penalties fail clearly rather than falling back to token budgets; reject unsupportedcandidate_countif explicitly configured rather than claiming multi-candidate support. Internal NoThinking emits LOW/no summary without invalid fields. Config-inherited, clone, routed, fallback and MCP-sampling paths tested. Basis: C2, C3, C16, G4, G5, G8. -
P1.3 Thinking UI offers only low/medium/high for Argon and recognizes the model offline; existing Gemini 2.5 and 3 behavior remains unchanged. Do not advertise “none” as true off. Basis: C2, C3, G4, G8.
-
P1.4 Ignored sampling settings are omitted with a clear diagnostic when explicitly supplied; no automatic temperature setting for Argon rerank. Prefill/model-ending histories are validated or surfaced as unsupported without silently deleting user history. Basis: C2, C20, G4, G5, G8.
-
P1.5 Argon's 20-minute idle policy covers direct and fallback execution with synthetic time; cancellation and shorter caller deadlines still win. Other models retain prior timeout behavior. Basis: C5, G6.
-
P1.6 Snapshot includes Argon context/modalities/reasoning/prices; generated diff reviewed for upstream inconsistencies. Offline example parsing passes. Protocol cap tests do not depend on the questionable models.dev output/temperature fields. Basis: C4, C14, C17, C22, G4, G6, G9, M1.
-
P1.7 Standard text/tool requests ≤65,536 are exercised against local HTTP/SSE fixtures. Signed sequential and parallel function calls preserve provider IDs, names, response order and signatures across session save/load. Basis: C1, C11, C12, C13, C22, G4, G8, G11.
-
P1.8 — Auxiliary requests and reusable features: exercise title generation (128-token cap, 30-second deadline), rerank, compaction and MCP sampling; preserve explicit ceilings/deadlines, omit Argon-inert rerank temperature, and never emit invalid zero/numeric thinking budgets. Treat the short-title risk as a hypothesis, not an observed production failure; document the existing inexpensive
title_modelescape hatch rather than globally raising auxiliary caps. Regress structured JSON, text/image/video/audio/PDF input conversion, implicit-cache accounting, Search/Maps/code execution/URL context, and mixed custom/built-in tools (IncludeServerSideToolInvocations). No new tool engine or explicit-cache creation. Basis: C2, C11, C12, C13, C14, C15, C16, C20, G4, G5, G8, G11. -
P1.9 — Operational documentation and scope: document paid Developer API keys vs Cloud ADC/project/location, wrapper/token-source fallback, gateway entitlement/timeouts as separately unverified, and the standard explicit
max_tokensceiling (32,768–65,536) inside the single 1,048,576 shared input/thinking/tool/output window. Explain backend-specific implicit-cache thresholds; token-only pricing and dated overrides are not full invoices or automatic Gemini tier pricing. Clearly separate unset medium from unsupported off/minimal, standard support from future long decode, and text output from unsupported image/audio generation or Live. Include the new example and descriptive schema/thinking-guide updates without changing frozen config types or the default model. Basis: C1, C2, C3, C5, C14, C15, C16, C17, G4, G5, G6, G8, G9, G10, M1.
P2 — [depends on P1] Preserve terminal outcomes and context accounting
Likely files: pkg/model/provider/gemini/adapter.go, adapter_test.go, streaming_test.go; pkg/chat/chat.go plus usage/serialization tests; pkg/runtime/streaming.go, event.go, compaction/budget/usage/restore tests; session cloning/persistence code and tests where the new optional value is copied.
Acceptance:
-
P2.1 Finish-only and prompt-feedback-only events are processed. MAX_TOKENS → length; explicit safety refusal → refusal; malformed function/protocol failures remain failures. Refusal voids any earlier streamed calls. CONTINUATION never masquerades as stop; incomplete empty thinking-only answers remain distinguishable. Basis: C6, C18, G5, G6, S2.
-
P2.2 Introduce optional initial/context-input metadata with legacy fallback, preserving normal single-hop behavior. No mutation of billed token buckets. JSON save/load and branch/resume retain it; cloning has no aliasing; multi-message
Usage.Addsemantics are explicit. Basis: C8, C9, C12, C19, G6, S3. -
P2.3 Synthetic multi-hop accounting: two hops each generating 60,000 tokens from an original 1,000-token prompt yield billed input 1,000 + 61,000 = 62,000, but context occupancy 1,000 + 120,000 = 121,000, not 182,000. Cost/token-spend budget sees all billed inputs; compaction/UI sees context size. Cache and reasoning buckets remain disjoint/correct. Keep only the latest within-hop usage; do not re-add repeated terminal usage. Basis: C8, C9, C10, C19, G6, S2, S3.
-
P2.4 Preserve real errors/cancellation and available usage when a later hop fails. Large synthetic chunk streams remain bounded by configured limits and do not trigger premature completion/tool execution. Basis: C5, C6, C8, C9, C10, G6, S2.
-
P2.5 — Signed-part fidelity and replay boundary: regress signature-only chunks, first signed function call per sequential step, parallel call IDs/names/results ordering, save/load and mixed built-in/raw parts. Do not require a blanket transcript rewrite for ordinary Argon. If deterministic long-hop/built-in fixtures establish missing ordered/multiple signed-part fidelity, reuse sealed
chat.ProviderStatereplay; test invalidation after visible edits, model switches and compaction before enabling it. Do not introduce a competing persistence mechanism. Basis: C11, C12, C21, C22, G8, G11, S2.
P3 — [depends on P1 + P2] Upgrade SDK and enable full long decode
Likely files: go.mod, go.sum; pkg/model/provider/gemini/client.go, adapter.go to populate SDK initial count; new local HTTP/SSE continuation tests alongside streaming_test.go; pkg/runtime integration tests; provider docs/example long-decode note.
Acceptance:
-
P3.1 Upgrade only the relevant dependency to verified v1.75.0 (or a newer separately reviewed release), tidy, build/test/lint. Do not bundle an unrelated dependency sweep. Official minimum is v1.74.0; use v1.75.0 for its fixes. Basis: C7, S1, S2, S3, G6.
-
P3.2 A local fixture producing more than 65,536 tokens with explicit
max_tokens: 262144causes multiple SDK GenerateContent requests, each retaining original prompt/tools/config and carrying the latest top-level token. No new user turn, no “continue” prompt, no duplicated function execution. ≤65,536 requests remain ordinary bounded calls. Basis: C1, C11, C12, C13, C16, C17, G6, S2. -
P3.3 Verify Developer API
v1betaand Cloudv1beta1; gateway passthrough separately tested, not assumed. Stop at MAX_TOKENS even if it includes a token: do not automatically raise the user's spending cap. Basis: C1, C17, G5, G6, S2. -
P3.4 Cover thinking-only first hop, signature-only/usage-only chunks, checkpoint-only chunks, final MAX_TOKENS, blocked prompt/no candidates, malformed tool response, HTTP rejection, repeated empty reconnects, dropped streams before and after checkpoints, EOF/error preservation, and cancellation mid-hop/reconnect. Test final text/history exactly once. Basis: C6, C11, C12, C18, C22, G6, G11, S1, S2.
-
P3.5 Read Go
UsageMetadata.InitialPromptTokenCount(), not an invented serialized REST field; integration asserts P2 accounting on actual SDK-generated cumulative responses. Basis: C8, C9, C10, C19, G6, S3. -
P3.6 Run a large local fixture and resume/save-load tests. Record deterministic results and the remaining live-validation gap. Only with separate authorization and a spend cap should a future smoke test cover a short response/tool roundtrip and one chosen long-decode case on each intended backend. No paid test is authorized, promised, or represented as run by this epic. Basis: C12, C19, C22, G4, G5, G6, S2.
-
P3.7 — Retry and scale gate: demonstrate exactly-once visible text/history and tool dispatch for dropped streams before/after checkpoints, or explicitly block reconnect-safety claims and fix the upstream/adapter gap. SDK public streaming yields chunks as received; its version alone is not proof of deduplication. For large synthetic streams, record output-limit enforcement, cancellation responsiveness, persistence size/latency and TUI/API responsiveness; do not claim measured scalability without results. Use a narrow proven fix only if needed, not a separate broad continuation/retry framework. Basis: C1, C5, C6, C11, C12, C21, C22, G6, S1, S2, S3.
Delivery policy: if SDK bump must land before P2, explicitly keep automatic continuation disabled in that intermediate change and do not advertise long decode; prefer the sequence above. No new YAML feature is needed to opt in: existing max_tokens supplies the ceiling. Any genuinely new config property must go only in pkg/config/latest, update the schema and include an example; frozen vN packages stay untouched.
Source-checked existing configuration and staged settings (not a live test)
The following uses the verified ID and existing config fields. It is source-checked, not executed against the live API. It intentionally omits thinking_budget while the current Argon mapping is wrong, and does not claim long decode or eliminate the existing idle/finish-reason limitations.
version: "16"
models:
argon:
provider: google
model: gemini-4-argon
max_tokens: 65536
bypass_models_gateway: true
agents:
root:
model: argon
description: General assistant using Gemini 4 Argon
instruction: Help the user accurately and explain relevant uncertainty.
Set GOOGLE_API_KEY (or GEMINI_API_KEY) from a paid-tier project. For this direct-API example, do not enable GOOGLE_GENAI_USE_VERTEXAI; bypass_models_gateway intentionally selects the direct provider rather than assuming a configured gateway serves Argon.
If metadata is stale/offline, existing optional model fields can be added without code changes:
capabilities:
image: true
pdf: true
audio: true
video: true
provider_opts:
context_size: 1048576
cost: # Developer API standard introductory token rates through 2026-11-30
input: 2
output: 10
cache_read: 0.10
The price override becomes stale on 1 December and does not include grounding charges or alternate service tiers; omit it when trusting a fresh catalog. context_size informs compaction; it does not create an independent output allowance. A separate already-supported title_model can avoid running short auxiliary title requests through Argon.
For Cloud, retain provider: google / model: gemini-4-argon, authenticate with ADC, and add provider_opts.project: <your-project> and provider_opts.location: global. These keys select the existing Cloud backend; do not invent an argon or enterprise provider. API account/project permissions and live behavior remain to be tested.
After P1: thinking_budget: medium (or low/high) becomes the intended valid setting. After P2+P3: use an explicit higher cap such as max_tokens: 262144 for long decode; it is not a sensible universal default.
Validation matrix and definition of done
All rows below are planned, not run. Reuse existing local HTTP/SSE fixtures and offline-example/snapshot tests rather than requiring paid inference for deterministic coverage. C22
| Area | Required cases / observable oracle | Gate |
|---|---|---|
| Auth/backend | Direct key aliases; Cloud ADC and explicit token-source transports; global/us/eu; wrapper fallback; Developer v1beta vs Cloud v1beta1; gateway passthrough independently covered, not assumed |
P1/P3 |
| Model controls | Omitted effort → server medium; only low/medium/high; explicit none/minimal/numeric rejected before defaults erase intent; NoThinking → LOW/no summary; no silent explicit-cap enlargement; ignored sampling diagnosed/omitted, incompatible penalties rejected |
P1 |
| Configuration paths | Explicit/inherited settings, clones, model switching, routed/fallback calls, title/rerank/compaction/MCP sampling; Gemini 2.5/3 unchanged; no default-model change | P1 |
| Metadata/input | Generator-refreshed snapshot and offline recognition; modalities/capabilities/context/cost overrides; catalog temperature/output discrepancies cannot drive protocol policy; JSON structured output and implicit-cache usage | P1 |
| Tools/signatures | Sequential/parallel custom tools and mixed built-ins; provider IDs/names/order; first-call-per-step signatures, signature-only chunks and save/load; no premature/duplicated tool execution | P1–P3 |
| Idle/cancellation | Scoped 20-minute Argon policy with fake/synthetic time, including fallback; other models unchanged; shorter context deadline/cancellation wins; stalled/repeated reconnects terminate | P1/P3 |
| Terminal outcomes | Text-free finish/prompt feedback; MAX_TOKENS → length; explicit safety → refusal (void earlier calls); malformed function/protocol errors preserved; leaked CONTINUATION not success; thinking-only/empty outcomes distinguishable | P2/P3 |
| Billing/context | Two-hop 1,000 + 61,000 input = 62,000 billed; 1,000 + 120,000 generated = 121,000 context, not 182,000; latest snapshots only; disjoint cache buckets and reasoning not double-counted; cost/spend vs compaction/UI/hooks/telemetry semantics explicit | P2/P3 |
| Persistence | Optional initial/context input JSON round-trip, clone without pointer alias, resume/branch/restore, legacy fallback; Usage.Add not blindly summing response-local initial counts; conditional ProviderState invalidation after edit/switch/compaction |
P2/P3 |
| Continuation | Explicit 262,144 ceiling, original request/tools retained, top-level token carried, one assistant turn; <=65,536 unchanged; MAX_TOKENS never automatically raises cap; thinking/usage/signature/checkpoint-only chunks | P3 |
| Failures/retry | Blocked prompt/no candidates, malformed tools, HTTP rejection, empty reconnects, drops before/after checkpoint, EOF and real errors, partial billed usage retained, cancellation mid-hop/reconnect; text/history exactly once | P3 |
| Scale/regression | Large local synthetic stream: finite ceilings/cancellation, persistence and TUI/API responsiveness measured; targeted tests plus task build, task test, task lint and tidy dependency diff |
P3 / all changes |
| Live/backend access | Entitlement, actual gateway support, regions, production disconnections and tool results remain unverified; future paid smoke tests only with separate approval/budget; record evidence or explicit gap per backend | Not authorized here |
Implementation epic closure (not this publication task): all P1/P2/P3 deterministic acceptance criteria pass, complete docs/examples are delivered, native GenerateContent long decode is correctly opt-in and gated by billing/context and terminal semantics, compatibility regressions pass, and backend/live limitations are explicitly recorded. Do not label a backend live-validated without actual separately authorized evidence. This issue does not authorize a merge.
Limitations and delivery boundaries
- This issue publishes a source-backed design, not a tested implementation. No repository edits, branches, commits, PRs, child issues, model generations, or paid API calls were made for publication. No build/test/lint is claimed: there is no patch. Authoritative code baseline is the immutable SHA above.
- The source assessment recorded HTTP 200 for core official guides and launch sources; its AI Studio learn guide returned an empty body and is not relied upon. Account entitlement, production gateway allow-lists/timeouts, regional deployment access, SDK reconnect behavior in production and live tool results were not verified.
- Official docs and models.dev are mutable. The 30 September restricted announcement is historical; the later 13 October GA/developer documentation supersedes it. A model card is a capability/safety source, not the wire protocol. Third-party metadata is not authoritative for supported parameters or access. G1, G2, G3, G4, G5, M1
- Keep API/backend contracts separate: Developer Interactions background execution differs from Cloud GenerateContent continuation; Cloud currently documents no Interactions long decode. Do not import Interactions steps/events/usage into the GenerateContent adapter. G5, G6, G7
- Existing authorization/sandbox boundaries remain unchanged. Cyber Permissive is restricted Fairwind-approved project entitlement, not a local safety bypass. No consumer subscription is an API credential. G4, G5
- Non-goals / optional follow-ups: new provider, Interactions/background/resumable server sessions, handwritten continuation engine, new auth or tool engine, explicit caching, native file-search stores, preview computer use, dynamic/agentic video controls, full grounding/code-result rendering, unconditional raw transcript rewrite, automatic tier/grounding invoice estimation and batch workflows. No image/audio generation or Live promises. Conditional fidelity fixes proven necessary by tests are covered by P2.5, not a blanket rewrite. C1, C11, C12, C13, C14, C15, C16, C21, G4, G5, G6, G7, G8, G9
- Repository conventions: follow AGENTS.md and the contributing guide: minimal well-justified comments, existing patterns/contextual error handling, adjacent deterministic tests with mocked external dependencies, atomic signed and DCO-signed-off Conventional Commits if implementation is later authorized, and canonical build/test/lint. Follow the dependency skill for isolated upgrade/tidy/validation; no unrelated dependency sweep. New config properties, if genuinely needed, go only in
pkg/config/latest, with schema/example updates; frozenvNpackages stay unchanged. Provider clients are team-load scoped, so any conversation-specific behavior belongs in request context/middleware rather than cached client construction. - Related-issue deduplication: all-state searches for Argon, “Gemini 4” and “long decode”, plus current Gemini-labeled issues, found no existing canonical support epic at publication. No child issues were opened.
Evidence index
The full source index is embedded below so readers need no internal artifact access. Reference-style inline citations resolve to the primary URL in each entry; each entry preserves all relevant supplementary links. Official sources were retrieved in the 15 October 2026 assessment; repository and SDK code use immutable commits.
Official Google sources (retrieved 15 October 2026)
- G1 — Original announcement, 30 Sep: Gemini 4 Argon. Earlier restricted rollout, pricing, long-output motivation.
- G2 — Developer launch, 13 Oct; general availability launch; API changelog.
- G3 — Model card, published 13 Oct. Multimodal inputs, text output, combined context; knowledge cutoff March 2026; possible slowness/timeouts.
- G4 — Developer API Argon model; latest-model migration guide.
- G5 — Cloud Argon model; Cloud Argon developer guide. IDs, regions, backend parameters and v1beta1 restriction.
- G6 — GenerateContent long decode. SDK minimum versions, continuation request/response shape, checkpoint handling, output caps, 20-minute timeout, billing vs context, initial input metadata.
- G7 — Interactions long decode. Developer background/storage requirement, statuses, step joining, event IDs/reconnection and cumulative usage. Not the current docker-agent API.
- G8 — Cloud developer guide: long decodes and migration; thinking guide.
- G9 — Argon pricing. Introductory/end-date, token rates, tiers and grounding charges.
- G10 — Rate limits. Project-scoped and account/tier-specific.
- G11 — GenerateContent thought signatures; Cloud thought signatures. Gemini 4/3 first-call signatures, sequential steps, optional non-call signatures, skip sentinel. The old
/docs/thought-signaturespage redirects users toward the general thinking guide.
SDK evidence (immutable source)
- S1 — v1.75.0 release, 14 Oct. Model enum plus continuation retry, grounding merge, prompt-feedback fixes. Tag resolves to
eeed5bd4ec1a994a335cf11e3f31601e53d11ae6. - S1a — Release fix provenance: empty-candidate continuation state/prompt feedback; grounding metadata merge; dropped-hop retry, prompt feedback stop and error preservation; Interactions enum addition (not an Interactions migration requirement).
- S2 — v1.75 GenerateContentStream; continuation state/retry handling; backend API-version defaults.
- S3 — InitialPromptTokenCount methods; client-side fallback/storage. Inspected pinned v1.71 models source and types: no continuation/initial-prompt mechanism.
docker-agent immutable source
All links are pinned to inspected main, not moving branch URLs.
- C1 — Gemini construction/auth; request/model passthrough.
- C2 — Gemini buildConfig and thinking mapping; Gemini-3-only detection.
- C3 — Google effort map; default selectable levels; none normalization; local recognition/UI.
- C4 — Snapshot date; embedded snapshot; store fetch/cache/fallback; refresh generator.
- C5 — Runtime idle policy; timer resets; HTTP client; idle/fallback tests.
- C6 — Adapter forwarding and synthetic terminal; terminal mapping.
- C7 — Go SDK pin.
- C8 — Usage mapping; Usage struct/Add.
- C9 — Session usage writes; context gauge; compaction consumption.
- C10 — Cost calculation/override; token-spend budget.
- C11 — Signature sentinel and tool/history conversion; tool-response tests.
- C12 — Stream signatures/tools; runtime signature retention; message persistence; session cloning.
- C13 — Existing built-ins and function declarations; mixed tools.
- C14 — Attachment conversion; caps override and missing metadata; context override.
- C15 — Service-tier request; pricing adjustments are OpenAI-only.
- C16 — Existing config fields; cost and capabilities types; current version.
- C17 — Catalog max-token option; clone cap propagation; simple metadata limits.
- C18 — Runtime refusal/length handling.
- C19 — Restored usage events.
- C20 — Title cap/deadline; title clone options; rerank config.
- C21 — Existing raw-provider-state abstraction.
- C22 — Snapshot regression pattern; offline examples validation; HTTP/SSE fixture pattern.
Third-party metadata, not API authority
- M1 — Live models.dev catalog, fetched 15 Oct 2026. Google and Google-Vertex Argon records exist; cited discrepancies captured in the accompanying small evidence file. Other aggregator records are not proof of paid account access or supported wire features and are not recommended as the primary route.
- 主要语言
- Go
- 星标
- 4.4k
- 派生
- 508
- 平均合并
- 8 小时 10 分钟
- 30 天内合并 PR
- 231
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/docker-agent 的其他 Issue
-
pkg/hooks tests fail with a misleading assertion when jq is not installed可能已有人在做 @dwin-gharibi 于 54 天前认领。 未关闭area/testing
难度 2/5 1-3 小时 新手友好度 86/100
docker/docker-agent#4052 ·
维护者通常 1 天内回复
-
`remove_directory` and `create_directory` hide work they already did when a later path fails可能已有人在做 @dwin-gharibi 于 72 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 85/100
docker/docker-agent#3933 ·
维护者通常 1 天内回复
-
`edit_file` silently edits the first match when `oldText` occurs more than once可能已有人在做 @dwin-gharibi 于 72 天前认领。 未关闭area/tools
难度 2/5 1-3 小时 新手友好度 78/100
docker/docker-agent#3929 · 2 条评论 ·
维护者通常 1 天内回复
-
Native API: distinguish provider finish_reason from inferred EOF completion (follow-up to #3669)未关闭area/api area/providers/openai area/runtime
难度 4/5 3-5 天 新手友好度 45/100
docker/docker-agent#4624 ·
维护者通常 1 天内回复
-
[Flaky test] TestHandleStream_ContextCancellation可能已有人在做 @aheritier 于 1 天前认领。 未关闭area/testing automated flaky-test status/needs-triage
docker/docker-agent#4617 · 已指派 2 人 ·
维护者通常 1 天内回复
查看 docker/docker-agent 的全部 Issue
相似的 Issue
-
documentation good first issue
难度 2/5 1-3 小时 新手友好度 90/100
维护者通常 1 天内回复
-
raised-by:reviewer
难度 1/5 1-3 小时 新手友好度 90/100
medici-finance/assay#3333 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 88/100
onurbaydas/VirtoMir#9 ·
-
enhancement good first issue
难度 1/5 1 小时以内 新手友好度 95/100
syncronix-labs/aegora#12 ·
-
auto-fixable pkg:api
难度 2/5 1-3 小时 新手友好度 82/100
tphakala/birdnet-go#4650 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复