Skip to content

fix(config): wire TOOL_OUTPUT_MAX_CHARS and the documented compose settings - #82

Closed
HamzaKhanBUIC wants to merge 1 commit into
getdownandcode:mainfrom
HamzaKhanBUIC:fix/wire-documented-settings
Closed

HamzaKhanBUIC wants to merge 1 commit into
getdownandcode:mainfrom
HamzaKhanBUIC:fix/wire-documented-settings

Conversation

@HamzaKhanBUIC

Copy link
Copy Markdown

Summary

Fixes #69.

Wires Settings.TOOL_OUTPUT_MAX_CHARS into get_agent() and exposes all documented configuration environment variables in docker-compose.yml.

Problem

  1. �gentkit/api/deps.py:get_agent() omitted ool_output_max_chars when instantiating AgentConfig, causing the application to always use the hard-coded default (2000 chars) regardless of TOOL_OUTPUT_MAX_CHARS in the environment.
  2. docker-compose.yml omitted SEARCH_API_KEY, RATE_LIMIT_PER_MIN, MAX_STEPS, TOOL_TIMEOUT_S, SESSION_TTL_S, TOOL_OUTPUT_MAX_CHARS, LLM_MAX_RETRIES, LLM_RETRY_BASE_DELAY_S, and LLM_RETRY_MAX_DELAY_S, running containerized deployments with hidden defaults and preventing web_search from functioning without manual compose edits.

Solution

  • In �gentkit/api/deps.py: Passed ool_output_max_chars=settings.TOOL_OUTPUT_MAX_CHARS to AgentConfig(...).
  • In docker-compose.yml: Exposed all documented environment variables with ${VAR:-...} fallback defaults.
  • In docs/SPEC.md and docs/AGENTKIT_SPEC.md: Aligned documented variable list with the full Settings schema.
  • In ests/unit/test_config.py:
    • Added unit test asserting get_agent() wires TOOL_OUTPUT_MAX_CHARS to �gent.config.tool_output_max_chars.
    • Added async integration test asserting tool outputs exceeding configured limits are truncated during agent execution.
    • Added test validating 100% parity between Settings.model_fields and docker-compose.yml �pi.environment.
    • Added test ensuring all settings remain documented in docs/SPEC.md and docs/AGENTKIT_SPEC.md.

Verification

  • uv run pytest tests/unit/test_config.py -> 8/8 passed
  • uv run ruff check . -> All checks passed
  • uv run ruff format --check . -> 110 files already formatted
  • uv run mypy agentkit tests/unit/test_config.py -> Success: no issues found in 43 source files
  • Structural AST lint & Semgrep security check -> Clean

Copilot AI balanced review requested due to automatic review settings October 20, 2026 22:02

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AUDIT-12 — Medium — TOOL_OUTPUT_MAX_CHARS ignored; compose omits documented settings

2 participants