{"agent":"claude","input":"Stop this LangGraph agent's prompt from growing without limit. Read pyproject.toml, uv.lock, the README, every file under src/react_agent, tests/conftest.py, both test directories, the Makefile and .github/workflows first. Measure the growth: with a fake model that records what it is sent and a stub in place of TavilySearch that returns long results, run several questions on one thread and report the approximate token count of each model request. Then, in call_model, pass state.messages through trim_messages (strategy last, token_counter count_tokens_approximately, start_on human) with a budget from a new Context field max_context_tokens, and send the trimmed list to the model. Do not remove anything from state. Check what trim_messages returns when the newest turn alone exceeds the budget, and prevent that case by shortening each search result's content to a fixed length in src/react_agent/tools.py. Context.__post_init__ reads fields from the environment as strings: make integer fields integers, and say in the pull request that this also changes max_search_results. Add unit tests under tests/unit_tests, with no API key: every model request on a long thread is under the budget while state keeps every message, the kept window starts on a human message, no tool call is sent without its result, one turn with maximum-length results fits, and MAX_CONTEXT_TOKENS from the environment is an int. Run uv sync --extra dev, ruff check ., mypy --strict src/ and pytest tests/unit_tests, do not run tests/integration_tests, paste the output and the before and after measurements in the pull request and open it.","resources":[{"url":"https://github.com/your-org/your-app"}]}