Repository navigation
feat(narratives): update default Gemini model to gemini-3.8-flash - #503
Merged
nick-nlb merged 4 commits intoOct 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the default Gemini model from gemini-3-flash-preview to gemini-3.8-flash across the configuration, client, workflows, schemas, and tests. Additionally, because gemini-3.8-flash rejects the minimal thinking level, the minimal option has been removed, and a new LIGHTWEIGHT_THINKING_LEVEL constant set to low has been introduced and integrated into the chart configuration, validation, and follow-up workflows. New unit tests have been added to verify that these workflows correctly request the low thinking level. There are no review comments, and I have no additional feedback to provide.
nick-nlb
marked this pull request as ready for review
October 3, 2026 00:23
juliawu
approved these changes
Oct 3, 2026
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.
Overview
This PR is the fifth stage of the Narratives model loop migration. It makes
gemini-3.8-flashthe default Gemini model and fixes the one incompatibility found when testing the agent against that model: the three lightweight structured calls (chart configuration, chart validation, and follow-up questions) requestedthinking_level="minimal", whichgemini-3.8-flashrejects with400 INVALID_ARGUMENT: Thinking level MINIMAL is not supported for this model.The rejection is easy to miss. Each of those calls is designed to fail quietly, so on the new model every turn would have completed normally with no charts and no follow-up questions, and nothing would have surfaced except a logged error. The unit tests mock Gemini, so CI could not catch it. The change was therefore verified against the live model as well as the unit suite.
Related Issues
This PR follows #494, #495, #496, and #501 in the Narratives model loop migration.
Changes Made
"low"thinking level through a shared constant. The unsupported"minimal"level was removed from the client's mapping so any caller requesting it falls back to"low".gemini-3-flash-previewtogemini-3.8-flashin config, schema defaults, example configs, and docstrings."low"and that"minimal"normalizes to"low". Updated client test defaults to use the new model.Behavior changes
gemini-3.8-flashunlessgemini.mcp_modelis set."low", the lowest levelgemini-3.8-flashaccepts. On the live model each finished in 1.5 to 3 seconds.null:gemini-3.8-flashreturns explicitnullfor optional chart fields (parent_place,child_place_type,date) where the previous model omitted them. Every consumer already tolerates this:tile_chart.tsxsets each attribute only when the value is truthy,titlefalls back through??, andvariable_dcidsdefaults to[]inuse_sse_chat.ts. No change was needed.Testing Done
Verified the Python agent locally from
narratives/agent/:Ran the UI type-check, the full workspace test suite, and the production build from
narratives/with the Node version from.nvmrc:nvm use pnpm -C ui run lint pnpm test pnpm buildAll 138 UI tests and 499 agent tests pass.
Manual verification against the live
gemini-3.8-flashmodel:narratives/agent/, ensureconfig.jsonsetsgemini.api_keyand does not overridegemini.mcp_model(or sets it togemini-3.8-flash), exportMCP_SERVER_URL=https://api.datacommons.org/mcp,DATA_PLANE_URL=https://api.datacommons.org,DATA_PLANE_WEB_URL=https://datacommons.org, andDC_API_KEY, then runuv run narratives-agent-dev.narratives/, runpnpm -C ui run devand openhttp://localhost:3000.get_chart_configandvalidate_data_responsesucceed atthinking_level="low"rather than failing with HTTP 400 on"minimal"), and emits follow-up questions on thefollow_upsSSE event.Risk & Rollback
Low risk. Narratives has no active deployments. A deployment that sets
gemini.mcp_modelkeeps its configured model. To roll back, revert the merge commit onnarratives-dev.Follow-ups
async_gemini_request(..., thinking_level="minimal"), and a test asserts that value. Switch it toLIGHTWEIGHT_THINKING_LEVEL(or"low"if feat(narratives): add HMAC-chained transcripts, state slots, and multi-turn context #501 merges first). Once this PR merges, the client sends"minimal"as"low", so compaction keeps working, but the call and its test should say what is actually sent.Checklist
AGENTS.mdand followedCODING_GUIDELINES.md, plusFRONTEND.mdfor UI changes.