Repository navigation
feat(ai): Gemini 4 Argon, sized as it is — its window, its reasoning, and room to think - #108
Merged
Merged
Conversation
… and room to think Argon reaches the picker from the gateway roster (systemu-net/thin.ly#451) and from OpenRouter with an own key. Until now it fell to the `gemini` heuristic: a 1,000,000 window instead of 1,048,576, and no reasoning flag. - providers/catalog.js: rows for `google/gemini-4-argon` and the bare id — 1,048,576 context, tools, vision, reasoning, never `fast`. Only the vendor-prefixed id (how OpenRouter and the gateway name it) carries `effort: 'medium'`; reasoningEffortFor() answers it, and 'low' for compaction. - openaiCompat.buildChatBody sends `reasoning: { effort }` when asked; index.js now forwards reasoningEffort on the chat, one-shot and agent paths. Chat and the agent ask for the row's effort. - agent.js: a model whose caps say it reasons gets the 32,768 per-turn ceiling (the gateway's PAID_MAX_TOKENS), because its reasoning comes out of the same max_tokens. That also covers o-series and Kimi K3. - Compact: a reasoning model summarizes with 8,192 tokens instead of 1,500, which reasoning alone could use up, and asks for a low effort. Tests: catalog and buildChatBody cases; a provider case that the field reaches the request body on all three paths; agentReasoningBudget runs the real agent loop; compactReasoningHost runs the real compaction function; sessionExpiredHost now hands the chat the real catalog and checks its effort. All 14 changes were undone one at a time with the network refused, and each was caught. The gate passes on macOS (126 files, also with Linux-like slow timers). Live: kimi-k3-spike.js against google/gemini-4-argon passed with this branch's request builder and effort=medium.
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Higher billable token ceilings across reasoning models warrant human validation, with desktop, browser, and real multi-step Argon checks still outstanding.
0 open findings
What changed in this PR
Adds editor-side Gemini 4 Argon support to LevelCode’s shared desktop and web AI implementation, complementing the live model roster.
Changes:
- Defines Argon’s exact context window and capabilities.
- Forwards reasoning effort through chat, agent, and compaction requests.
- Raises reasoning-model token budgets and adds regression coverage.
| File | Description |
|---|---|
extensions/levelcode-ai/test/sessionExpiredHost.test.js |
Checks chat reasoning effort. |
extensions/levelcode-ai/test/providers.test.js |
Tests effort forwarding into request bodies. |
extensions/levelcode-ai/test/compactReasoningHost.test.js |
Tests compaction budgets and effort. |
extensions/levelcode-ai/test/catalog.test.js |
Checks Argon capabilities and effort selection. |
extensions/levelcode-ai/test/agentReasoningBudget.test.js |
Tests agent token budgets. |
extensions/levelcode-ai/providers/openaiCompat.js |
Serializes reasoning effort. |
extensions/levelcode-ai/providers/index.js |
Forwards effort through provider dispatch. |
extensions/levelcode-ai/providers/catalog.js |
Adds Argon metadata and effort helper. |
extensions/levelcode-ai/extension.js |
Applies chat effort and compaction settings. |
extensions/levelcode-ai/agent.js |
Raises reasoning-model budgets and selects effort. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the editor half of the Gemini 4 Argon launch (Step 2 of the launch plan). The catalog row is what puts Argon in front of Pro users: systemu-net/thin.ly#451. That row works without this PR, because the picker reads
/account/modelslive. This PR makes the editor treat Argon as what it is, and it can ship in any release.What changes
geminiheuristic: a 1,000,000 window instead of 1,048,576, and no reasoning flag.providers/catalog.jsnow has rows forgoogle/gemini-4-argonand the baregemini-4-argon: 1,048,576 context, tools, vision, reasoning, neverfast, so it never becomes the ghost-text model.reasoning: { effort: "medium" }, and compaction sends"low". Before, no effort was sent, so Google's default applied, which is unknown.reasoningfor every Argon endpoint, and the gateway passes the body through.max_tokensas its answer, and the agent's 8,192 default can be spent on thinking alone. A model whose caps say it reasons now gets the 32,768 per-turn ceiling, which is also the gateway'sPAID_MAX_TOKENS.The web build runs the same
extensions/levelcode-aisource, so it picks all of this up.Tests
catalog.test.js: the two Argon rows, andreasoningEffortFor.providers.test.js: thebuildChatBodyfield, and that the effort reaches the request body on the chat, one-shot and agent paths (index.jscopies options field by field).agentReasoningBudget.test.js: runs the real agent loop with a stand-in provider and reads what each turn asked for.compactReasoningHost.test.js: runs the realcompactAgentMemory, sliced out ofextension.js.sessionExpiredHost.test.js: now handshandleSendthe real catalog, which it needs, and checks the chat's effort.scripts/test-extensions.shpasses on macOS with Node 24, 126 files, and again with everysetTimeoutdelayed by 15 ms, as on the Linux runner.tsc --checkJsfinds no new undefined names.scripts/kimi-k3-spike.jsagainstgoogle/gemini-4-argonpassed with this branch's request builder andeffort: medium. Turn 1 called the tool; turn 2 answered without reasoning carried back.Not run
For the next release notes
RELEASE-NOTES.mdondevelopstill holds v1.3.0's notes and is replaced each release, so I did not touch it. Suggested entry: