Repository navigation
fix(agent): respect deliberately small context windows - #6152
kovtcharov-amd merged 4 commits into
Conversation
|
Fixed the only actionable CI failure in Verification on the pushed head:
The local pytest run emitted the pre-existing Windows temporary pytest-link cleanup warning only after the successful test result; it did not affect the exit status. CI has been re-triggered by the push. Slai Agent Runtime assisted with investigation, implementation, and test execution. The account owner reviewed and authorized this contribution and is responsible for the submitted content. |
The original tests checked only the comparison helper and grepped the source, so they could not catch a regression in the agent loop. These drive both the streaming and non-streaming overflow branches with 4K/8K/16K llama.cpp errors and confirm they trim and retry, check that an undersized load still re-raises for a reload, and exercise the health probe with an exact client pin, malformed pins and no chat client. Also drops the comment that still described the removed substring check.
|
Thanks @huong8373tt-beep — dropping the hard-coded 4K/8K/16K list is the right fix, and honouring an exact client pin in the health probe closes the second half of the same bug. I pushed two small things to your branch and merged in current
🔍 Technical details
|
## Why this matters v0.25.4 is cut for Arabic support: the Agent UI runs right to left in Arabic, and people can ask about Arabic, English or mixed documents in either language (amd#6165). It also adds a local-only mode that keeps every AI request on the PC, image indexing, and email thread reading for the GAIA agent. Among the fixes, chats no longer get stuck on "Waiting for the GPU", and file paths resolve to the chat's folder and the real Documents folder. 59 commits since v0.25.3; the notes are in `docs/releases/v0.25.4.mdx` and credit 7 outside contributors. This is a patch carrying 8 `feat` commits, approved as v0.25.4 for the Arabic RC. ## Test plan - [x] `python util/validate_release_notes.py docs/releases/v0.25.4.mdx --tag v0.25.4` passes, and with `--tag v0.25.4-rc1` - [x] `mintlify validate` (from `docs/`) passes - [x] `python util/release_versions.py --check`, `python util/check_doc_links.py --internal-only` and `python util/check_doc_versions.py` pass - [x] `python util/check_component_core_api.py --release-version 0.25.4` passes - [x] `pytest tests/unit/test_docs_json_release.py tests/unit/test_check_component_core_api.py tests/unit/test_release_tag.py tests/unit/test_hub_core_version_gate.py tests/unit/test_release_versions.py hub/agents/gaia/python/tests/test_npm_doc_min_version.py`: 230 passed - [x] Re-run the above after amd#6165 merged and main was merged in - [ ] CI green on the merge commit - [ ] `release_train_dryrun.yml` passes on that commit before the RC tag ## Evals to re-run on the RC tag LLM-affecting PRs merged without per-PR evals; run these on `v0.25.4-rc1`: - `rag_quality` and `real_world` (amd#6165, amd#6057) - `gaia_rag` and `gaia_media` (amd#5651) - `gaia_email` (amd#6124) - `gaia_skills_tasks` and `gaia_skills_lifecycle` (amd#5450, amd#5454, amd#6080) - `gaia_files` and `gaia_shell` (amd#6069, amd#6074, amd#6120) - `gaia_code` (amd#6056) - `gaia_core` and `context_retention` (amd#6152) - `gaia_data` and `tool_selection` (amd#6053, amd#6130) - `memory` and `gaia_memory` (amd#6127, amd#6081) - `gaia_tool_selection` for tool confirmations (amd#5541) ## Release checklist - [ ] Keep amd#6114 unmerged until v0.25.4 is tagged, so main stays on 0.25.4 - [ ] Freeze main, wait for green CI on the exact commit, pass `release_train_dryrun.yml`, then push `v0.25.4-rc1` (the RC freezes its own flagship; no agent release needed) - [ ] Before the final: release the flagship from the release commit (`agent-pkg-gaia-v<next>`), merge its pin-lock PR, and pass `check_flagship_release.py` - [ ] Extend the changelog if main gains commits before the tag
Summary
Fixes #5284. Context-overflow handling previously treated literal 4K/8K/16K text in the backend error as proof that the model was loaded with the wrong window. That breaks users who intentionally pin a smaller context window: the turn is re-raised for a reload instead of using the normal trim-and-retry path.
Changes
ctx_size_overrideas the requested target when deciding whether a reload is needed.Tests
python -m pytest tests/unit/agents/test_context_window_overflow.py -q(5 passed)python -m py_compile src/gaia/agents/base/agent.py tests/unit/agents/test_context_window_overflow.pygit diff --checkGenerated with AI assistance.