Conversation
) Previously, _chat_helpers.py always passed model_id=<session model> explicitly to registry.create_agent(), defeating kwargs.setdefault("model_id", ...) in custom agents — which only fires when the key is absent. Fix: build create_kwargs conditionally, omitting model_id when the session is at the DB default so the agent's __init__ setdefault governs. Also use agent.model_id (post-construction) for both _store_agent cache key and the pre-flight _maybe_load_expected_model call. Three-branch precedence: custom_model setting > session-explicit > omit kwarg. Closes #841
…N_DEFAULT_MODEL Addresses code review feedback on PR #842: - Export SESSION_DEFAULT_MODEL from database.py (single source of truth) instead of duplicating the string literal in _chat_helpers.py - Extract _build_create_kwargs() helper to eliminate the duplicate three-branch create_kwargs logic across non-streaming and streaming code paths - Extract _effective_model() helper using explicit None check (not `or`) to safely read agent.model_id post-construction without treating empty string as missing - Fix static regression guard regex to use [^()]* so nested helper calls inside create_agent() are not falsely flagged - Update unit test to import SESSION_DEFAULT_MODEL instead of hardcoding
…ion (#842) _store_agent was changed by the #842 fix to use _effective_model(agent, model_id) as the cache key — the post-construction value set by kwargs.setdefault. _get_cached_agent still looks up using the pre-construction model_id variable. For custom agents whose setdefault model differs from the session model, the keys never match and the agent is rebuilt on every turn. Revert the two _store_agent call sites to use model_id (the pre-construction intent key), matching what the lookup uses. _effective_model stays at the two _maybe_load_expected_model sites (Lemonade pre-flight needs the actual model) and in log statements (observability). Add two regression guards: - test_cache_hit_on_second_turn_for_setdefault_agent: two-turn cache-hit test with four assertions (call count, object identity, stored-key equality, agent.model_id). Covers the builder/template.py setdefault pattern. - test_no_effective_model_in_store_agent_calls: static grep guard that asserts _store_agent never receives _effective_model(...) as a positional arg, preventing this pattern from silently returning in a future cleanup pass.
#817) ## Summary One-line fix: swap the failing `www.cs.cmu.edu/~tom/EMNLP2004_final.pdf` URL in `docs/plans/email-triage-agent.mdx:2601` for the canonical ACL Anthology record at [W04-3240](https://aclanthology.org/W04-3240/). The CMU URL fails DNS resolution in CI (see [recent run](https://github.com/amd/gaia/actions/runs/24595902571/job/72072156929)), breaking the ``Verify external URLs`` check for every open PR that touches docs. ACL Anthology is the permanent archive for ACL/EMNLP papers — stable URL, no more link rot. Also restored the paper's actual full title ("Learning to Classify Email into 'Speech Acts'") for consistency with the other full-title citations in the same references list. ## Test plan - [x] `curl -sI https://aclanthology.org/W04-3240/` returns 200 - [ ] After merge, `Verify external URLs` check should go green on downstream PRs
Patch release: custom agents now honor their declared model, and the C++
library no longer crashes on null JSON fields from smaller LLMs.
- Custom Agent UI agents honor kwargs.setdefault("model_id", ...) when the
session is at the DB default (#841, follow-up #842 restores cache hits).
- C++ library adds null-safety guards in parseLlmResponse() to tolerate
smaller LLMs that return null for "tool" or "content" (#780).
- Docs: swap broken CMU link for canonical ACL Anthology URL (#817).
SummaryPR #855 is the v0.17.4 release: a version bump plus the Issues Found🟢 Minor — Release notes changelog undercounts commits (
|
GAIA v0.17.4 Release Notes
GAIA v0.17.4 is a patch release covering two correctness fixes in the Agent UI custom-agent path, a null-safety fix in the C++ library for smaller LLMs, and a broken docs citation.
Why upgrade:
kwargs.setdefault("model_id", ...), the Agent UI now respects that setting when the session is at the DB default, instead of falling back to the session model.nullvalues in"tool"and"content"fields, which some smaller models emit in place of omitting the field.What's New
Custom Agent
model_idRespected in the Agent UI_chat_helpers.pypreviously passedmodel_id=<session model>explicitly toregistry.create_agent(), which defeatedkwargs.setdefault("model_id", ...)in custom agents —setdefaultonly fires when the key is absent (PR #841). The Agent UI now buildscreate_kwargsconditionally, omittingmodel_idwhen the session is at the DB default so the agent's__init__setdefault governs. Three-branch precedence is now explicit:custom_modelsetting > session-explicit model > agent's ownsetdefault.A follow-up fix (PR #842) restored the pre-construction
model_idas the agent-cache key. The initial PR #841 landing had switched_store_agentto use the post-construction_effective_model(agent, model_id)while_get_cached_agentstill looked up withmodel_id, so keys never matched for custom-model agents and the agent was rebuilt on every turn. A two-turn cache-hit regression test and a static guard on_store_agentcall sites were added alongside the fix.Supporting refactor: extracted
_build_create_kwargs()and_effective_model()helpers insrc/gaia/ui/_chat_helpers.pyto deduplicate the three-branch logic across streaming and non-streaming paths, and exportedSESSION_DEFAULT_MODELfromdatabase.pyas the single source of truth.C++ Library: Null-Safety in LLM Response Parsing
parseLlmResponse()incpp/src/json_utils.cppnow guards.get<std::string>()calls on the"tool"and"answer"JSON fields with.is_string()/.is_null()checks (PR #780). This fixes a crash (json.exception.type_error.302: type must be string, but is null) when smaller LLMs (for exampleqwen3.5:9b) returnnullfor those fields instead of omitting them.json.contains()returnstruefornullvalues, so the existing presence checks were insufficient.Bug Fixes
www.cs.cmu.edu/~tom/EMNLP2004_final.pdfURL indocs/plans/email-triage-agent.mdxfor the canonical ACL Anthology record at W04-3240. The CMU URL was failing DNS resolution in CI, breaking theVerify external URLscheck on every open docs PR. Restored the paper's full title ("Learning to Classify Email into 'Speech Acts'") for consistency with other citations in the same references list.Full Changelog
5 commits since v0.17.3:
8fc43f3f— fix(cpp): add null-safety checks for JSON string fields in LLM response parsing (fix(cpp): add null-safety checks for JSON string fields in LLM response parsing #780)62722de2— fix(ui): honor custom agent model_id when session is at DB default (bug: GAIA AgentUI ignores custom agent model choice #841)4acfd400— fix(ui): extract _build_create_kwargs/_effective_model, import SESSION_DEFAULT_MODEL8f5c7621— fix(ui): restore intent-key for agent cache store to fix miss regression (fix(ui): honor custom agent model_id when session is at DB default #842)a0fdb109— docs(plans): fix broken CMU link to EMNLP 2004 Email Speech Acts paper (docs(plans): fix broken CMU link to EMNLP 2004 Email Speech Acts paper #817)Full Changelog: v0.17.3...v0.17.4
Release checklist
util/validate_release_notes.py docs/releases/v0.17.4.mdx --tag v0.17.4passessrc/gaia/version.py→0.17.4src/gaia/apps/webui/package.json→0.17.4docs/docs.json→v0.17.4 · Lemonade 10.0.0