fix(pm-agent): log the CLI's stdout envelope when triage fails; add PM_DECISION_MAX_TURNS
`claude --print --output-format json` reports its own failures (API error, usage limit, error_max_turns) as the result envelope on stdout and leaves stderr empty, so ask_pm()'s stderr-only message logged "claude exited 1: " with nothing after it, twice on 2026-10-31. describe_cli_failure() now logs the envelope's diagnostic fields plus stdout/stderr tails, redacted (sk-ant-, Bearer/token, URL userinfo). PM_DECISION_MAX_TURNS (default 1, unchanged) makes the max-turns remedy a ConfigMap change if the envelope turns out to say error_max_turns. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
95e08da2f0
commit
664ee82b9a
3 files changed
+178
-4
No files matched your search
@@ -250,6 +250,12 @@ five that matter:
|
||||
| `PM_MAX_ACTIVE_WORKERS` | `2` | concurrent workers. RAM is the binding constraint (2Gi limit each) and the subscription seat's rate limits are shared with every other use of that seat |
|
||||
| `PM_MAX_NEW_WORKERS_PER_CYCLE` | `1` | drains a backlog one issue at a time instead of in one stampede the first minute the credentials work |
|
||||
| `PM_PUSH_ON_RED_GATE` | `false` | a change the gate refused is not pushed; the issue gets the gate log instead |
|
||||
| `PM_DECISION_MAX_TURNS` | `1` (unset) | turns the triage call may take (1–5). The PM holds no tools, so a second turn is only ever the CLI re-asking after an answer that failed the decision schema. Raise it if a triage error logs `subtype='error_max_turns'` |
|
||||
|
||||
**When a triage fails**, the `[error] issue #N: claude exited …` line carries the CLI's result
|
||||
envelope (`subtype`, `is_error`, `api_error_status`, `num_turns`, `result`) and the tails of
|
||||
stdout and stderr, redacted. Before 2026-10-31 it logged stderr only, which is empty under
|
||||
`--output-format json` — see `decisions/2026-10-31-pm-agent-triage-exit.md`.
|
||||
|
||||
Changing a knob requires bumping the `config-generation` annotation in `deployment.yaml` in
|
||||
the same commit — the process reads its configuration once, at startup, so without the bump
|
||||
|
||||
Reference in new issue
Block a user