Skip to content

feat(providers): make agent iteration limit and session timeout configurable#44

Merged
jrob5756 merged 2 commits intomainfrom
feature/configurable-agent-iteration-limits
Mar 17, 2026
Merged

feat(providers): make agent iteration limit and session timeout configurable#44
jrob5756 merged 2 commits intomainfrom
feature/configurable-agent-iteration-limits

Conversation

@jrob5756
Copy link
Copy Markdown
Collaborator

Summary

Closes #40.

  • Add max_agent_iterations (1–500) and max_session_seconds as configurable parameters at both workflow runtime level and per-agent level
  • Claude provider: raise default iteration cap from 10 → 50, add wall-clock session timeout via time.monotonic()
  • Copilot provider: add tool iteration counting on tool.execution_start events, enforce limit in _wait_with_idle_detection
  • Thread both params through factory and registry to both providers
  • Update max_session_seconds to apply to both providers (previously Copilot-only)
  • Raise Copilot SDK floor pin from >=0.1.0 to >=0.1.28 (required for on_permission_request)
  • 34 new tests covering schema validation, factory threading, and both provider behaviors

Example YAML:

runtime:
  provider: claude
  max_agent_iterations: 100
  max_session_seconds: 900
agents:
  - name: coder
    max_agent_iterations: 200
    max_session_seconds: 1800

Test plan

  • make lint passes
  • make check (lint + typecheck) passes
  • uv run pytest — 1734 passed, 9 skipped
  • Validated and ran test workflows locally with Claude provider
  • Validated and ran test workflows locally with Copilot provider

🤖 Generated with Claude Code

@jrob5756 jrob5756 closed this Mar 17, 2026
@jrob5756 jrob5756 reopened this Mar 17, 2026
…gurable (#40)

Add `max_agent_iterations` and `max_session_seconds` as configurable
parameters at both the workflow runtime level and per-agent level,
giving users control over tool-use loop limits and wall-clock timeouts
for both Claude and Copilot providers.

- Add `max_agent_iterations` to RuntimeConfig and AgentDef schemas
  (range 1–500, default None → provider default: Claude 50, Copilot unlimited)
- Update `max_session_seconds` to apply to both providers (was Copilot-only)
- Claude provider: raise default from 10 → 50 iterations, add wall-clock
  session timeout via time.monotonic()
- Copilot provider: add tool iteration counting on tool.execution_start
  events, enforce limit in _wait_with_idle_detection polling loop
- Thread both params through factory and registry to both providers
- Raise copilot SDK floor pin from >=0.1.0 to >=0.1.28 (on_permission_request)
  and lock to 0.1.30
- Add CI step to remove bundled copilot binary (prevents auth hang in tests)
- Add 10-minute timeout on CI test step
- Add 34 new tests covering schema, factory, and both provider behaviors

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrob5756 jrob5756 force-pushed the feature/configurable-agent-iteration-limits branch from 83a57d1 to 9f96cf6 Compare March 17, 2026 01:24
Performance tests use timing-sensitive assertions (e.g., for-each must
complete within 1.5x of static parallel) that fail intermittently on
shared CI runners. The test file is already marked with
@pytest.mark.performance — just add it to the CI exclusion filter
alongside real_api tests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jrob5756 jrob5756 merged commit cd06d2a into main Mar 17, 2026
7 checks passed
@jrob5756 jrob5756 deleted the feature/configurable-agent-iteration-limits branch March 17, 2026 01:41
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.

Claude provider: agentic loop max_iterations=10 too low and not configurable

1 participant