Repository navigation
feat: configure the host agent recursion limit - #352
Conversation
b9f6cfb to
5b1b6ce
Compare
eshulman2
left a comment
There was a problem hiding this comment.
Found one issue:
[P2] Invalid recursion settings block unrelated config queries — src/forge/cli.py, lines 1320–1328.
If forge.agent_recursion_limit is malformed or its read fails, get-config --property forge.repos now exits with an error and returns no repository value. get-config --models is similarly blocked. Restrict this error handling to requests for the recursion property and full configuration output so other configuration queries remain usable.
Review was based on the diff and surrounding code; I did not run tests.
|
Addressed in d1e35d7.
Verified with TDD: 12 regression cases failed before the fix; all 20 new cases now pass. The full suite passed with 3,677 passed and 25 skipped under |
Together with PR #351, this PR closes the AISOS-2535 feature.
Host agent graphs can currently use Deep Agents' much larger recursion budget, allowing a stuck task to run far longer than intended. This PR sets Forge's default host graph limit to 100, supports a positive integer global
AGENT_RECURSION_LIMIT, and reads the liveforge.agent_recursion_limitJira project property before each ticket run. A missing or null property uses the global value; malformed values and failed reads stop the run. Transient Jira reads have bounded retry and timeout behavior.project-setupcan set or clear the project override, andget-configshows the raw value, effective value, and source in text and JSON, including actionable diagnostics for invalid values. The resolved limit is fixed for each invocation and passed through native, tool-fallback, and retry paths. Graph recursion exhaustion is terminal for that invocation and cannot trigger another graph attempt.The branch also contains Python 3.12 warning cleanup needed to satisfy the requested warnings-as-errors gate: existing naive-UTC timestamp wire formats are preserved without deprecated
utcnow(), Redis testcontainers is imported only when needed, and parser/station/pytest fixtures close their event loops.Validation: this branch independently passed the complete Python 3.12 suite with
-W error(3,611 passed, 25 skipped). In a separate worktree combined with the Vertex PR, the complete suite passed (3,657 passed, 25 skipped). Redis-dependent tests ran only on the host against a disposable local Redis Stack container. Ruff passed for all changed Python files, and targeted mypy passed for the new policy and time modules.The limit applies to host graph invocations, not container agents or a shared ticket-wide budget. Live provider probing, deployment, and AISOS-2485 recovery remain separate release gates.
Review Follow-Up (2026-10-05)
Addressed the CLI query-isolation review in commit d1e35d7:
get-config --modelsand unrelated--propertyqueries no longer read or validateforge.agent_recursion_limit, avoiding unrelated errors and retry delays. Case-insensitive queries and discovered custom properties are covered.project-configalias.Latest verification: 117 focused tests passed; the full suite passed with 3,677 passed and 25 skipped under
-W error. Ruff checks and formatting pass for the changed Python files, and every modified executable line and branch is covered. An independent focused review found no issues.Verification gaps are explicit: 20 legacy workflow tests are intentionally disabled, three tests require the Kind workspace, and two checkpointer tests reported Redis unavailable despite the disposable integration-test Redis being available. Those two skips remain an investigation follow-up, not successful checks; no Jira issue has been created for them yet. The extra CLI mypy check reports the same 25 errors as the unchanged PR baseline, with no new errors introduced by this fix.