Skip to content

Expose max tool-call rounds per chat turn as admin-configurable #75

Open

Description

@prometheusgr

Context

docs/CONFIG_AUDIT_2026-09-04.md found that backend/app/agents/chat_agent.py:16 hardcodes MAX_TOOL_CALL_ROUNDS = 5 — capping how many tool-call round-trips (e.g. repeated search_knowledge_base calls) one chat turn can make before the agent is forced to answer. This is a classic operational ceiling (cost/latency vs. thoroughness tradeoff), in the same spirit as the already-DB-backed rate-limit capacity fields, but isn't itself configurable.

Scope

  1. Add nullable SystemSettings column chat_max_tool_call_rounds (int, ge=1), env-default fallback.
  2. New or extended resolver (likely a small addition to an existing resolver, or its own resolve_chat_agent_config if none fits — follow docs/BACKEND_SERVICES.md).
  3. Wire into chat_agent.py, replacing the module constant.
  4. Add to the Settings UI (likely a new small "Chat Agent" section, or folded into an existing one if a natural fit emerges during implementation) with a tooltip.
  5. Audit-log on change.

Definition of Done

  • chat_max_tool_call_rounds nullable column + Alembic migration.
  • Resolver function, unit-tested.
  • Wired into chat_agent.py.
  • Settings UI field + tooltip.
  • Audit logging on change.
  • RBAC call-out per AGENTS.md TDD Discipline step 0: admin feature.
  • Standard merge gate from AGENTS.md's Definition of Done applies in full.

Activity

  1. added
    polishAdmin/UI surfacing or refinement of existing capability, not new functionality
    type:improvementMakes an existing capability better/safer/more complete
    priority:P3Deferred/speculative — explicitly not scheduled yet
    effort:SSmall: single file/component, hours not days
    area:chat-uxChat UI/agent runtime behavior visible to users
    on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:chat-uxChat UI/agent runtime behavior visible to userseffort:SSmall: single file/component, hours not dayspolishAdmin/UI surfacing or refinement of existing capability, not new functionalitypriority:P3Deferred/speculative — explicitly not scheduled yettype:improvementMakes an existing capability better/safer/more complete

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions