Skip to content

fix(ci): raise dev-agent's --max-turns from 40 to 70 - #259

Merged
libravault-xyz merged 1 commit into
devfrom
fix/dev-agent-max-turns-too-low
Aug 18, 2026
Merged

libravault-xyz merged 1 commit into
devfrom
fix/dev-agent-max-turns-too-low

Conversation

@libravault-xyz

Copy link
Copy Markdown
Collaborator

What

Raises dev-agent's --max-turns from 40 to 70 in .github/workflows/dev-agent.yml's triage-and-implement step.

Why

Closes the root cause investigated in #258: #8, #89, #137, and #178 have each failed twice in a row with the identical num_turns: 41, subtype: error_max_turns signature — genuine multi-file implementation work cut off mid-turn, not a crash. Every retry burns the same ~40 turns for zero progress since nothing about a bare retry changes how much work the issue needs. Full evidence and log excerpts in #258.

Scope

Deliberately narrow: only dev-agent.yml's implementation step, which is where all 4 observed failures happened. qa-agent.yml/principal-review.yml stay at 40 — no evidence yet that their (narrower, verify-only) work is hitting the same wall; worth a separate look if error_max_turns ever shows up for them.

Sensitive path

This touches .github/workflows/**, which .github/agent-policy.yml marks risk:high / human-merge-only regardless of author. Opening this as a normal human-authored PR for exactly that reason — please review and merge directly rather than routing through the agent pipeline.

Follow-up

Once merged, #8/#89/#137/#178 should be re-triggered (toggle status:ready-for-dev off/on) to get a real attempt at the new budget — the health-check routine will likely pick these up on its own next cycle since they're the same issue numbers it's been retrying.

Closes #258 (or leave open if you want to also revisit qa-agent/principal-review's budgets — your call).

Confirmed via job logs that #8, #89, #137, and #178 have each failed
triage-and-implement twice in a row with an identical signature:
num_turns: 41, subtype: error_max_turns. These are genuine multi-file
implementation tasks (an iOS Swift bugfix, a new Android Compose
feature) doing real productive work right up until the cut-off — not
crashes, not the stale-branch OIDC issue (#254), not transient infra
flakiness. Retrying without raising the budget is guaranteed to fail
identically every time, since nothing about a retry changes how much
work the issue needs.

No branch/commit survives a max-turns death (the agent runs in an
ephemeral Actions checkout and never reaches git push before being
cut off), so every retry has been wasting a full ~40-turn API budget
for zero net progress.

qa-agent.yml and principal-review.yml are left at 40 — their crash
history so far is the OIDC issue, not evidence of legitimate
max-turns exhaustion, and their work (verify vs. implement) is
narrower by design. Revisit those independently if the same
error_max_turns signature shows up for them.

See issue #258 for the full investigation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge label Aug 18, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-qa PR open, awaiting qa-agent verification label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR was opened outside the automated pipeline (author isn't libravault-pipeline-bot[bot]), so dev-agent.yml's own end-of-run classification step never ran for it — it would otherwise have sat with no risk/status label and nothing downstream would pick it up (see issue #223's actual history). This deterministic backstop (pr-intake.yml) classified its risk and applied status:needs-qa to route it into the normal pipeline from here.

@github-actions

Copy link
Copy Markdown
Contributor

📱 iOS Build Status: PASSED

✅ iOS Simulator Build & Unit Tests - success
✅ Android Core Modules - success

iOS UI tests run in a separate, informational job and are not reflected above — check "iOS UI Tests (informational)" for those.

View run details

@claude

claude Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

QA verification — PR #259 vs issue #258

Diff scope check — confirmed via git diff origin/dev -- .github/workflows/dev-agent.yml: exactly one line changed, --max-turns 40 → --max-turns 70 in the triage-and-implement step. No other files touched, matching the PR description exactly. qa-agent.yml and principal-review.yml are untouched, confirmed still at --max-turns 40 — consistent with the PR's stated "deliberately narrow" scope.

Acceptance criteria — issue #258 is a bug report (no explicit checklist), so the bar is "repro no longer reproduces + evidence." This is a CI-workflow config bump, not application logic: the actual repro (issues #8/#89/#137/#178 hitting error_max_turns at num_turns: 41) can only be re-verified by actually re-running dev-agent against those issues post-merge, which the PR correctly defers to a documented follow-up step rather than claiming false certainty here. What I can and did verify:

Tests — ran the real suite in full, in the foreground:

./gradlew testDebugUnitTest --continue
...
BUILD SUCCESSFUL in 7m 48s
431 actionable tasks: 333 executed, 98 from cache

No failures. Per AGENTS.md, this change is a "build-script bump"-class edit (CI workflow numeric config, zero application code touched) — explicitly exempted from the "ship unit tests" requirement, and there's no meaningful unit test that could exercise a GitHub Actions --max-turns value anyway. No test gap here.

Regressions — none plausible; the change has no code-path impact outside the dev-agent GitHub Actions job itself, and the full JVM suite passing confirms nothing else in the tree was touched or broken.

AGENTS.md conventions:

  • ✅ Branch name fix/dev-agent-max-turns-too-low matches fix/<short-slug>.
  • ✅ Commit fix(ci): raise dev-agent's --max-turns from 40 to 70 is Conventional Commits, one concern.
  • ✅ No hardcoded secrets/versions issues; single scalar bump.

Sensitive path — .github/workflows/** is risk:high / human-merge-only per .github/agent-policy.yml; PR already carries risk:high, and the PR body itself correctly flags this for direct human merge. No action needed from QA here beyond noting it's correctly labeled.

No status:blocked on either the PR or issue #258, so proceeding was appropriate.

QA verdict: PASS

@github-actions github-actions Bot removed the status:needs-qa PR open, awaiting qa-agent verification label Aug 18, 2026
@libravault-pipeline-bot libravault-pipeline-bot Bot added the status:needs-review QA passed, awaiting principal-review-agent label Aug 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Principal review — PR #259

Verdict: human-merge (routing purely on risk:high, not on any finding — see below).

Verified independently (not just read off the PR description)

  • Diff: exactly one line changed in .github/workflows/dev-agent.yml (--max-turns 40 → 70), confirmed via git diff --numstat origin/dev...HEAD — 1 file, 1/1 lines. qa-agent.yml and principal-review.yml checked directly and confirmed still at --max-turns 40, matching the PR's "deliberately narrow" claim.
  • Root cause: pulled the raw job log for issue [enhancement] Refactor LibraryScreen.kt #8's failed run (gh api repos/LibraVault/reader/actions/jobs/95530146037/logs) myself rather than trusting issue dev-agent (and qa-agent/principal-review) hard-coded --max-turns 40 is too low: 4 issues now fail identically twice, burning full budget with no progress #258's summary — confirmed "num_turns": 41 / "subtype": "error_max_turns" verbatim. The claimed failure signature is real, not a mischaracterization.
  • Risk label sanity check: .github/workflows/dev-agent.yml matches sensitive_paths pattern .github/workflows/** in agent-policy.yml, so risk:high is the deterministically correct classification. Single commit on this PR — label isn't stale.
  • QA: status:needs-review present, JVM Tests check is green, and the QA agent's PR comment shows a real foreground ./gradlew testDebugUnitTest --continue run (BUILD SUCCESSFUL, 431 tasks), not a mocked/assumed pass.
  • No new networking dependency/call. No other sensitive path touched. No status:blocked.

Findings

None at CONFIRMED (or even PLAUSIBLE) severity. This is about as low-risk a change as a sensitive-path edit can be: a single numeric CI budget bump, scope-limited to the one workflow with actual evidence of the failure mode, with an honest note that 70 vs. some other number is only verifiable by re-running the affected issues post-merge (which the PR defers to a documented follow-up rather than overclaiming).

Why human-merge anyway

agent-policy.yml marks .github/workflows/** sensitive specifically so a change to the pipeline's own execution budget always gets human eyes, independent of how small or well-justified it looks — and this PR's own description agrees, opening as human-authored for exactly that reason. Nothing here overrides that; recommend merging as-is.

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

Labels

risk:high Touches a sensitive path or exceeds diff-size threshold — always human merge status:needs-human-merge Principal review done, requires human merge decision

Projects

None yet

1 participant