Repository navigation
[2735 by Claude Opus 5.5] ## Add a stall and degenerate-output watchdog for running agent containers - #2757
Conversation
…lent, or that only emits whitespace, is now stopped instead of holding its worker slot and capacity lease for up to 24 hours. Typecheck, lint and all the affected test suites pass. Two suites didn't run (see the end). How it works - One place for all agents. The watchdog lives in the shared Docker executor (`dockerExecutionWatchdog.ts`, `agentActivityWatchdog.ts`), not in any agent's parser. It covers Claude, Codex, Antigravity, OpenCode and Vibe. - What counts as activity: any stdout or stderr output. For Vibe, a changed transcript snapshot also counts, since Vibe may print nothing to stdout. - Recognising text and tools: each stdout line is read for text deltas, tool starts and tool ends in each provider's format. - Rules: - Silence: no output for `AGENT_STALL_TIMEOUT_MS` (default 10 min) stops the run. - Silent tool calls: after a tool starts without streaming output, the limit becomes `AGENT_TOOL_STALL_TIMEOUT_MS` (default 30 min). A tool that keeps printing never trips it. - Whitespace output: `AGENT_DEGENERATE_OUTPUT_LIMIT` (default 50) consecutive whitespace-only deltas stop the run. Empty deltas don't count, and real text resets the count. - `0` disables a rule. For the tool limit, `0` means a running tool call is never cut off. - Stopping: it uses the same stop path as the execution deadline, so partial work is published exactly like a timed-out run. Runs get the new reasons `stalled` / `degenerate_output`, and the task ends with matching new `terminalReason` values. The stop happens at most once, and an outcome that is already in progress (deadline, user cancel, lost ownership) wins. - Settings: three new instance settings can be changed in the Settings UI (Automation → Agent watchdog), `propr setting update …` and MCP `update_execution_settings`. They are read at the start of each run, so no restart is needed. The env var is the default, `null` / `"default"` clears the override, and invalid values fall back to the default with a warning. - Observability: - Timeline: a task timeline entry records the rule, threshold, and seconds silent or whitespace-delta count. - Metrics: `GET /api/llm-metrics` now has a per-rule `watchdogTrips` count. - Inbox and comment: these come through the existing completion path. The termination description and the Inbox text now explain the watchdog stop. - Recovery: - Capacity lease: released as soon as the stopped container exits, as with any finished run. - Reconciler: when it replays a terminal state from Redis it now keeps `terminalReason`, so a watchdog-stopped task stays terminal rather than being treated as orphaned. - Usage-limit waits: a task parked for a usage limit has no running container, so it is never watched. Things to know - The task-to-terminal-reason mapping is in `src/jobs/agentTerminalReason.ts` rather than `@propr/core`. Several existing tests mock `@propr/core` with a fixed export list, and a new core export broke them. - The Settings API now also returns `agent_watchdog_defaults` and `agent_watchdog_effective`. I updated the four exact-match `getSettings` expectations in `test/configRoutes.followup.test.ts` to include them. - Vibe exposes its transcript only as snapshots, so for Vibe only the silence rules apply, not the whitespace-output rule. Tests - New: - watchdog state-machine and per-provider format tests - executor tests: stop on silence with partial output kept, output keeping a run alive, the tool threshold, whitespace stop, disabled never stops, stop called exactly once, capacity lease released - a reconciler test showing a `stalled` / `degenerate_output` task isn't re-marked orphaned - UI unit tests and a Playwright Settings test - Results: `tsc` is clean for the repo and the CLI. The UI's only errors are two existing ones from the unbuilt CLI package. Lint shows no errors. About 40 affected suites pass, including the full Settings UI suite (136 tests). - Not verified: - `test/llmMetrics.test.ts` produced no result in this environment; it probably needs a Redis server, which isn't installed here. - `packages/api/test/notificationProjectionService.test.ts` failed until I built `better-sqlite3`'s native module and rebuilt core, then passed. That was a sandbox setup problem, not a code issue. Docs are updated in `worker.md` (the "No inactivity timeout" line is replaced by a watchdog section), `execution-safety.md`, the configuration reference, the regenerated settings-locations page, `metrics.md`, the CLI docs and the CHANGELOG. I captured a screenshot of the new Settings section for the PR.
|
/ultrafix goal=8 max=5 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 5) First action:
|
|
✅ Applied the requested follow-up changes in commit 5998a96 Summary of ChangesI fixed the CodeQL "Improper code sanitization" alert in Cause: the test helper Fix:
The tests still check the same behaviour, and no production code changed. Checks: dependencies weren't installed in this workspace, so I ran 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…est/dockerExecutorWatchdog.test.ts`. All 9 tests in that file pass. I fixed the CodeQL "Improper code sanitization" alert in `test/dockerExecutorWatchdog.test.ts`. All 9 tests in that file pass. **Cause:** the test helper `runAgent` builds a small script and runs it with `node -e`. Several tests wrote their fake agent output into that script's source with `JSON.stringify(...)`, which is the pattern CodeQL flags. **Fix:** `runAgent` now takes an extra `data: string[]` parameter and passes those strings to the child process as arguments. The scripts are now fixed text and read the output from `process.argv[1]`, `process.argv[2]`, and so on. Three tests changed: - the silent-agent test - the tool-threshold test - the whitespace-output test (line 77, the one CodeQL flagged) The tests still check the same behaviour, and no production code changed. **Checks:** dependencies weren't installed in this workspace, so I ran `npm ci --ignore-scripts` first. ESLint skips this file because the lint config doesn't cover it, so there was nothing to lint. PR: #2757 Comment by: @github-advanced-security[bot] (ID: 4190224753) Model: claude-opus-5-5
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 4306f2a Processed 2 comments:
Summary of ChangesI fixed the CI failure. The Core Package Lint step was failing because To fix it, I moved the live-output streaming code out of Checks I ran:
There's nothing to preview, since this change isn't visible in the UI. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…ing because `packages/core/src/claude/docker/dockerExecutor.ts` had grown to 433 lines of code with the watchdog changes. The `max-lines` limit is 400, and CI treats any lint warning as a failure. I fixed the CI failure. The Core Package Lint step was failing because `packages/core/src/claude/docker/dockerExecutor.ts` had grown to 433 lines of code with the watchdog changes. The `max-lines` limit is 400, and CI treats any lint warning as a failure. To fix it, I moved the live-output streaming code out of `dockerExecutor.ts` into a new file, `packages/core/src/claude/docker/dockerLiveOutputStreaming.ts`. That covers `startLiveOutputStreaming`, the `LiveOutputStreaming` interface, and the ANSI-stripping helper, which nothing else in the executor used. I only moved the code; it doesn't change what the code does. The executor now imports the function from the new file. **Checks I ran:** - Typecheck for `packages/core` passes. - `eslint . --max-warnings 0` in `packages/core`, the same check that failed in CI, now passes. - `test/dockerExecutorWatchdog.test.ts` and `test/dockerExecutorLiveOutput.test.ts` both pass. There's nothing to preview, since this change isn't visible in the UI. PR: #2757 Comment by: @propr-dev[bot] (ID: 6006592532) Comment by: @github-actions[bot] (ID: 6006592936) Model: claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared watchdog, configurable thresholds, termination propagation, and observability. It is not ready to merge: three runtime gaps can terminate legitimate silent tool executions prematurely. ✅ Shared termination handling — Watchdog stops reuse the subprocess teardown path and preserve partial output for normal publication. ✅ Terminal reason propagation — The new reasons flow through agent results, task completion, reconciliation, and user-facing descriptions. The supplied current-head status shows 41 passed checks and no failures or pending checks. This review uses static analysis of the supplied code; no commands or tests were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F1: 🔴 Preserve activity during watchdog initialization
F2: 🔴 Track every tool in message blocks
F3: 🔴 Observe tool state in transcript snapshots
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe shared integration and passing checks are strong, but tool-state observation gaps undermine the default watchdog’s correctness. These require localized runtime fixes and targeted regression coverage before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 261822c
Summary of ChangesI fixed all three findings. The two watchdog test files pass (27 tests), and core typecheck and lint for F1 – tool start lost while settings load. The watchdog now exists from the start of the run, with thresholds that never trip until the real settings are loaded. Output that arrives while they load is recorded at the moment it arrives, including any tool that starts. When the settings come in, the new F2 – only the first tool in a message was counted. One output line can now report several things in order, for example some text followed by two tool starts. The watchdog tracks running tools by the provider's call id rather than a plain counter, using whichever id field each provider sends. Two cases are handled explicitly:
Checking other providers for the same problem turned up OpenCode. It repeats "running" updates for a single tool, and each one used to add to the count; the ids now prevent that. F3 – tools that only appear in the Vibe transcript. Each transcript poll now passes only the new, complete records to the watchdog's line classifier. If the transcript gets shorter (a new session file), reading starts again from the top, and the id tracking makes that re-read harmless. The classifier also understands Vibe's record format: an assistant message listing tool calls starts them, and a tool record ends one. The other agents' records are classified as before. New tests:
Limits:
There are no visual changes, so I didn't create any previews. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…s (27 tests), and core typecheck and lint for `src/claude/docker/` are clean. I ran the three new end-to-end regressions against the previous code and all three failed there. I fixed all three findings. The two watchdog test files pass (27 tests), and core typecheck and lint for `src/claude/docker/` are clean. I ran the three new end-to-end regressions against the previous code and all three failed there. **F1 – tool start lost while settings load.** The watchdog now exists from the start of the run, with thresholds that never trip until the real settings are loaded. Output that arrives while they load is recorded at the moment it arrives, including any tool that starts. When the settings come in, the new `configure()` method applies them without losing that state, and a run of whitespace-only output seen during loading still counts toward the limit. If loading fails or the watchdog is disabled, it stops watching. This is in `dockerExecutionWatchdog.ts`. **F2 – only the first tool in a message was counted.** One output line can now report several things in order, for example some text followed by two tool starts. The watchdog tracks running tools by the provider's call id rather than a plain counter, using whichever id field each provider sends. Two cases are handled explicitly: - **Results seen twice:** if the same result is reported again (on stdout and in a transcript), it is ignored, and a repeated start for a finished tool doesn't reopen it. - **No call id:** tools without an id fall back to a simple count. Checking other providers for the same problem turned up OpenCode. It repeats "running" updates for a single tool, and each one used to add to the count; the ids now prevent that. **F3 – tools that only appear in the Vibe transcript.** Each transcript poll now passes only the new, complete records to the watchdog's line classifier. If the transcript gets shorter (a new session file), reading starts again from the top, and the id tracking makes that re-read harmless. The classifier also understands Vibe's record format: an assistant message listing tool calls starts them, and a tool record ends one. The other agents' records are classified as before. **New tests:** - Unit tests (`packages/core/test/agentActivityWatchdog.test.ts`): reporting every tool in one line with its id; Vibe's record format; a two-tool message whose results arrive separately, including a duplicate result; replayed starts; output observed before the settings apply. - End-to-end tests (`test/dockerExecutorWatchdog.test.ts`): - A tool starts while settings are still loading (with the settings load mocked to take 400ms) and runs past the normal stall limit. - A two-tool message where the second tool stays silent after the first result arrives. - A tool seen only in the transcript: it gets the longer tool limit, and once its result appears the normal limit applies again. This test takes about 8.5 seconds because transcripts are polled every 2 seconds. **Limits:** - Tool state from the transcript is recorded when the poll runs, up to 2 seconds after the record was written. That delay comes from polling and can't be avoided without changing how Vibe output is read. - The root-level typecheck still reports one error: `@propr/local-setup` can't be found because that package hasn't been built in this container. It isn't related to these changes. - I installed dependencies with `npm ci` and built the shared, client and core packages to run these checks. No setup files were changed. There are no visual changes, so I didn't create any previews. PR: #2757 Comment by: @propr-ultrafix (ID: 0) Model: claude-opus-5-5
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared execution watchdog, configurable thresholds, termination reasons, and reporting across agent implementations. It needs localized corrections before merge: Vibe transcript text bypasses degenerate-output detection, and the settings UI can silently disable a valid timeout. ✅ Shared stop path — Watchdog trips reuse subprocess-scoped teardown and preserve partial output for existing publication paths. ✅ Terminal reason propagation — Watchdog reasons flow through agent results, issue completion, and terminal-state reconciliation. The supplied current-head checks report 41 passed, none failed or pending, and nine neutral/skipped. This review used static analysis only; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F4: 🔴 Classify Vibe assistant text without tool calls
F5: 🔴 Preserve timeout values when displaying minutes
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe shared execution integration and passing checks provide a strong foundation, but the provider coverage gap and unintended settings mutation require correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
✅ Applied the requested follow-up changes in commit 6248155
Summary of ChangesI fixed both findings. All affected tests pass, and each new regression fails against the previous code. Core and UI typecheck are clean, and lint is clean on the changed source files. F4: whitespace-only Vibe assistant messages now count
F5: saved timeouts no longer change when you click in and out of a field
Verification: the watchdog test files pass (29 tests), and so do all 19 SettingsPage test files (137 tests). To run them I had to install dependencies with I didn't make a visual preview. The only visible change is the number shown for timeouts that don't come out to a round number of minutes. 🤖 Implementation Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
…w regression fails against the previous code. Core and UI typecheck are clean, and lint is clean on the changed source files.
I fixed both findings. All affected tests pass, and each new regression fails against the previous code. Core and UI typecheck are clean, and lint is clean on the changed source files.
**F4: whitespace-only Vibe assistant messages now count**
- In `packages/core/src/claude/docker/agentOutputActivity.ts`, `classifyChatMessage` now treats the text of any untyped assistant message as agent text, whether or not it has `tool_calls`. Tool calls are still reported after the text, in order. An assistant message with empty content still counts only as activity. Messages from other roles, like `user`, are unaffected.
- I checked the other parsers in the same file, and they already treated assistant text as text. The Vibe chat format was the only one with this gap.
- Tests:
- In `packages/core/test/agentActivityWatchdog.test.ts`, the old expectation that `{ role: 'assistant', content: 'plain reply' }` is plain activity is now an expectation that it is text. I also added cases for whitespace text combined with a tool call, empty content, and `user` messages.
- A new watchdog test checks that consecutive whitespace messages trip the rule and that real text resets the count.
- A new end-to-end test in `test/dockerExecutorWatchdog.test.ts` keeps appending `" "` assistant messages to a Vibe-style transcript. The run now stops with `degenerate_output` after 3 messages. Before the fix it kept running, because each new snapshot reset the silence timer.
**F5: saved timeouts no longer change when you click in and out of a field**
- In `propr-ui/src/pages/SettingsPage/AgentWatchdogSettingsSection.tsx`, two changes:
- **Display:** `toDisplay` now shows minutes with the fewest decimal places that still convert back to the exact saved milliseconds. For example, 100 ms now shows as `0.00167` instead of `0`.
- **Saving:** the component remembers which fields you actually typed in. Leaving a field you didn't edit saves nothing, and the record of edits resets whenever the saved values change.
- A new test in `AgentWatchdogSettingsSection.test.tsx` uses 100 ms and 1,234 ms for the two timeout fields. It checks that neither displays as 0 and that clicking in and out of all three fields saves nothing. It also checks that re-entering the displayed minutes saves nothing, because they convert back to the exact stored value.
**Verification:** the watchdog test files pass (29 tests), and so do all 19 SettingsPage test files (137 tests). To run them I had to install dependencies with `npm ci` and `npm run test:prepare`, the same steps `.propr/setup.sh` runs. No setup files changed.
I didn't make a visual preview. The only visible change is the number shown for timeouts that don't come out to a round number of minutes.
PR: #2757
Comment by: @propr-ultrafix (ID: 0)
Model: claude-opus-5-5
|
/ultrafix goal=8 max=3 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 3) First action:
|
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared execution watchdog, configurable thresholds, terminal reasons, and operational reporting. It needs changes before merge: tool inactivity can be unintentionally disabled, and tool tracking can discard calls that have not finished. ✅ Shared teardown — Watchdog stops reuse the existing subprocess-scoped termination path and preserve partial output. ✅ Reason propagation — The new termination reasons flow through agent adapters, issue completion, and terminal-state reconciliation. ✅ Focused coverage — Added tests cover silence, whitespace, delayed settings loading, multiple tools, and capacity release. The supplied current-head status reports 36 passed checks and no blocking failures. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F6: 🔴 Disabling ordinary inactivity also disables tool inactivity
F7: 🔴 Text within a tool-call message closes unfinished tools
SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Exercise transcript replacement boundaries
ScoreThe implementation has substantial integration and passing checks, but two tool-state correctness defects require localized fixes. This review used static tracing only, as requested. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix F6 F7 |
|
✅ Applied the requested follow-up changes in commit 4e8579f
Summary of ChangesI fixed F6 and F7 in F6: a tool threshold alone now works
F7: text in the message that declares a tool no longer ends that tool
New tests
To run the tests I had to install dependencies with There's no visual change, so I made no preview. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…utputActivity.ts`. The two watchdog test files pass (34 tests). I swapped the old source back in temporarily and all four new regressions failed against it. Core typecheck and lint on the changed files are clean. I fixed F6 and F7 in `agentActivityWatchdog.ts` and `agentOutputActivity.ts`. The two watchdog test files pass (34 tests). I swapped the old source back in temporarily and all four new regressions failed against it. Core typecheck and lint on the changed files are clean. **F6: a tool threshold alone now works** - The watchdog now counts as enabled when only the tool threshold is positive. Before, turning off ordinary inactivity and degenerate detection stopped observation entirely. - When ordinary inactivity is 0, a running tool call now uses the tool threshold. Silence with no tool running still never trips. When both thresholds are positive, nothing changes: a running tool still gets the larger of the two. - I checked the related code paths. The poll interval already took the tool threshold into account, and startup still observes output that arrives while settings are loading. **F7: text in the message that declares a tool no longer ends that tool** - Each running tool call now remembers which message declared it. Text only ends calls declared by an earlier message. - For Claude, the message is identified by `message.id`. Claude sends a message's blocks as separate lines that share this id. The partial text deltas between them are tied to the id from the `stream_event` `message_start`. So the case is covered whether the tool and its text are in one line or spread across several. - Output with no message id (Codex, Vibe, OpenCode and others) treats each output line as one message. Text in a later line still ends running calls, as before. - Text recorded directly through `recordTextDelta` without a message context still ends every running call, as before. **New tests** - **Settings:** ordinary inactivity off and the tool threshold on, with degenerate detection both on and off. Ordinary silence never trips, and a silent tool trips at the tool threshold. There is also an end-to-end Docker run with only the tool threshold set, where a silent tool is stopped. - **Same line:** a tool call followed by text in one line, with and without a message id. The tool keeps its 5s allowance past the 1s ordinary threshold. - **Separate lines:** a tool call and text from the same Claude message arriving in separate lines, including partial deltas. The call stays open, and text from the next message closes it. - **No message ids:** text in a later line without message ids still closes running calls. To run the tests I had to install dependencies with `npm ci` and build the shared and local-setup packages, since `node_modules` was empty. No setup files changed. There's no visual change, so I made no preview. PR: #2757 Comment by: @integry (ID: 6009323846) Model: claude-opus-5-5
…ng whether the next `/review` can run. On a head like #2755/#2757, where only the `Validate unsigned *` and `Finalize unsigned validation checksums` checks fail, the review now runs. Lint and typecheck pass, and 828 tests across the affected suites pass, including the new ones. I haven't run a live loop on a real PR, so the posted comments and the timeout have only been exercised in tests. 1–2. Readiness respects non-blocking checks (`packages/core/src/webhook/checkRunHelpers.ts`) - `getCheckRunsStatus` takes an optional list of non-blocking patterns, so other callers behave as before. A new `getCheckRunsStatusForRepo` loads the repository's patterns the same way `checkRunHandler.ts` does. If that lookup fails, every check is treated as blocking. - Matching check runs and matching legacy commit statuses are ignored whether they failed or are still queued. Legacy statuses are now judged per check rather than by GitHub's single combined state. The result also lists which blocking checks failed and which are still pending. - All three Ultrafix readiness callers (daemon, worker and API) and the pre-review check in `ultrafixReviewExecutionGate.ts` now use the repository-aware version. - `areAllChecksPassing`, used for Epic queue advance and auto-merge, already skipped non-blocking check runs. It now skips non-blocking legacy statuses too. The auto-merge re-enable after Ultrafix doesn't look at checks, so it needed no change. 3–4. Deferral comment and bounded wait (new `src/jobs/ultrafixCiWait.ts`) - When CI defers a review, Ultrafix posts one PR comment listing the blocking checks and whether each failed or hasn't finished. That's one comment per head commit and loop run, not one per re-check. Nothing extra is posted when CI turns green. - If the review stays deferred longer than the timeout, the loop stops. It posts the existing "⚠️ Ultrafix stopped before reaching its goal" comment with the reason "CI did not settle". This applies at all three places a review gets deferred. - The timeout is a new instance setting, `ultrafix_ci_wait_timeout_ms`, defaulting to 2 hours. It can be changed through the settings API, MCP `update_execution_settings` and `propr setting update`. I also added an `ULTRAFIX_CI_WAIT_TIMEOUT_MS` environment override, which the issue didn't ask for. I didn't add it to the Settings UI. 5. `start_ultrafix` / `run_ultrafix` no longer reports `COMMAND_NOT_PICKED_UP` for a CI stall - A deferred review now shows as "waiting for CI" with the reason and the blocking checks. If the loop was stopped by the timeout, the operation shows as failed. - This also covers the case where no task picked up the command yet: the status is read from the loop's Redis records. `/ultrafix` gets the PR comment. Tests and docs - New tests cover: - the readiness cases the issue listed (all passing, failing and pending checks on either side of the patterns, legacy statuses mixed in). - the single deferral comment and the timeout stop. - the deferral path in the pre-review check. - the MCP receipt. - I updated a few existing test mocks and expected responses for the new export and setting. - Docs: added the Ultrafix wording in `pr-commands.md`, the environment variable in the configuration reference, a regenerated `settings-locations.md`, and a CHANGELOG entry under Unreleased. No visual preview, since nothing in the app's UI changed.
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR adds a shared watchdog, configurable thresholds, and propagation of watchdog termination reasons through task completion. It needs a localized correctness fix before merge. ✅ Shared execution integration — Watchdog stops reuse the existing subprocess teardown path and preserve partial output for eligible executions. ✅ Terminal reason propagation — The new reasons flow through agent adapters, issue completion, and terminal-state reconciliation. ✅ Focused coverage — Tests cover silence, whitespace output, delayed settings loading, concurrent tools, and capacity release. Current-head checks report 41 passed and no failures. This review is a static analysis of the supplied code; no commands were run. Merge blockersEvery finding below was introduced by this PR and must be resolved before merging. F8: 🔴 Close identified tools by key
SuggestionsThese are optional follow-ups and are not sent to No suggestions. ScoreThe shared integration, lifecycle propagation, and passing checks provide good confidence overall. One deterministic tool-tracking defect still undermines inactivity enforcement and requires correction before merge. Score: 6/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/fix F8 |
|
✅ Applied the requested follow-up changes in commit 5a34bb5
Summary of ChangesI fixed F8. When a tool completion arrived without an ID, the watchdog passed the oldest open call's scope string where it needed the call's ID. Nothing got closed, so the call stayed open after it had finished. Fix ( Regression (
The test failed against the old code (2 tools still open where 1 was expected) and passes with the fix. Same-mistake check: this was the only place that looks up a tool by reading from the map, in Verification:
To run these I had to install dependencies with I found nothing else outside F8's scope worth reporting. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…he watchdog passed the oldest open call's scope string where it needed the call's ID. Nothing got closed, so the call stayed open after it had finished.
I fixed F8. When a tool completion arrived without an ID, the watchdog passed the oldest open call's scope string where it needed the call's ID. Nothing got closed, so the call stayed open after it had finished.
**Fix** (`packages/core/src/claude/docker/agentActivityWatchdog.ts:117`): the fallback in `recordToolEnd` now reads the oldest map key (`this.openToolIds.keys().next()`) instead of its value. That key goes back into `recordToolEnd`, which closes the call and marks it finished.
**Regression** (`packages/core/test/agentActivityWatchdog.test.ts`, "a completion without an id closes the oldest identified call"): the test turns the tool threshold off (`toolStallTimeoutMs: 0`) and sends these records:
- `{"type":"tool_use","id":"t1"}`, then `{"type":"tool_use","id":"t2"}`, then `{"type":"tool_result"}`: only `t1` closes, so one tool stays open.
- A late `{"type":"tool_result","id":"t1"}`: this is treated as a duplicate and does not close `t2`.
- A second `{"type":"tool_result"}`: no tools are open, and one second of silence now stops the run as ordinary inactivity.
The test failed against the old code (2 tools still open where 1 was expected) and passes with the fix.
**Same-mistake check:** this was the only place that looks up a tool by reading from the map, in `agentActivityWatchdog.ts` and the rest of `src/claude/docker/`. The other loops over the map already use the `[id, scope]` pairs correctly.
**Verification:**
- `agentActivityWatchdog.test.ts`: 21 of 21 pass.
- `test/dockerExecutorWatchdog.test.ts` (end-to-end, run through `scripts/run-test-suite.mjs`, which mocks the modules it needs): 14 of 14 pass.
- `tsc --noEmit` for core is clean.
- ESLint passes on `agentActivityWatchdog.ts`. It skips the test file because no ESLint config covers it, same as before this change.
To run these I had to install dependencies with `.propr/setup.sh` and build `packages/shared`. I didn't change any setup files.
I found nothing else outside F8's scope worth reporting.
PR: #2757
Comment by: @integry (ID: 6009566721)
Model: claude-opus-5-5
|
/review |
|
✅ AI Code Review Complete requested by @integry Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe PR implements a shared execution watchdog, configurable thresholds, explicit termination reasons, and reporting across task state and metrics. The supplied diff supports merge readiness within scope, conditional on the pending checks completing successfully. ✅ Shared stop path — Watchdog trips reuse subprocess-scoped teardown and preserve partial output for implementation callers. ✅ Stateful tool tracking — Identified tool calls are tracked separately, and duplicate completion records do not close other outstanding calls. ✅ Termination propagation — The new reasons flow through agent adapters, issue completion, partial-work explanations, and terminal-state reconciliation. This was a static review of the supplied diff and context; no commands or tests were run. Current checks report 0 failures and 18 pending. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S2: 🟢 Bound observability completion
S3: 🟢 Add captured protocol fixturesThe classifier tests cover many useful cases, but their records are constructed examples. Sanitized fixtures captured from each supported runtime would strengthen confidence that tool starts, completions, and whitespace output match actual emitted records—especially for snapshot-based Vibe output. This is additional compatibility coverage, not a demonstrated defect in the current implementation. ScoreThe implementation is cohesive, with substantial focused coverage and no verified merge blocker in the supplied code. Pending checks still need to complete successfully. Score: 8/10 🤖 Review Details
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved the only conflict, in What the conflict was: Both branches added new entries at the top of
How I resolved it: I kept all three entries word for word, with the PR's watchdog entry first and Why: The entries describe separate features and don't overlap, so this was purely a position clash. Keeping all of them preserves the PR's intent and Check: I searched every tracked file for 🤖 Resolution Details
System-triggered merge conflict resolution |
…all-and-degenerat-20261005-2330-eo3 Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - CHANGELOG.md PR: #2757 Model: claude-opus-5-5
|
/merge |
|
🔀 Resolved merge conflicts from Conflicting Files
Resolution SummaryI resolved all 11 conflicted files, and no conflict markers remain anywhere in the repository. I couldn't run a full typecheck because TypeScript isn't installed in this workspace. Instead I parsed the 9 TypeScript files with the TypeScript compiler, and all of them parse cleanly. That confirms the syntax is valid but does not check types, so I also confirmed by reading the code that Why every conflict looked the same: this PR adds three agent watchdog settings (
Why I resolved it this way: both sides add independent settings or behaviour, so keeping everything preserves the PR's watchdog feature and main's CI-wait timeout and push salvage. The only real logic overlap was I tried to mark the files as resolved with 🤖 Resolution Details
System-triggered merge conflict resolution |
…all-and-degenerat-20261005-2330-eo3 Automatically resolved merge conflicts after merging target branch into PR branch. Resolved conflicts in: - CHANGELOG.md - docs/docs/operations/settings-locations.md - packages/api/mcp/settingsCatalog.ts - packages/api/mcp/toolsManagement.ts - packages/api/routes/configHelpers.ts - packages/api/routes/configRoutes.ts - packages/api/routes/configRoutesSettings.ts - packages/api/routes/configSettings.ts - packages/cli/src/api/settings.ts - packages/cli/src/commands/settingCommands.ts - src/jobs/issueJob/completion.ts PR: #2757 Model: claude-opus-5-5
|
CI failed: Validate Changes Please investigate and fix this CI failure.
Failure evidence
|
Checks FailedValidation failed during setup, tests, CLI packaging, linting, or build checks. View Logs |
|
✅ Applied the requested follow-up changes in commit 134eb9a Summary of ChangesI fixed the Validate Changes failure. Both problems came from code this PR added. The API lint now passes with zero warnings and Cause: The Playwright tests all passed (210). The job failed in the "Run Checks" step because the API lint allows no warnings, and it found two:
Fix (no change in behaviour):
Tests: The tests for the settings routes, follow-up, usage tips and reasoning level all pass. To run these checks locally I had to install dependencies and build a few packages first. None of that shows up in the changes; only the three files above changed. 🤖 Implementation Details
Undo Changes • View Task Execution 💡 ProPR Slash Commands
🤖 Generated by ProPR |
…e from code this PR added. The API lint now passes with zero warnings and `@propr/api` builds; CI hasn't re-run on the change yet. I fixed the **Validate Changes** failure. Both problems came from code this PR added. The API lint now passes with zero warnings and `@propr/api` builds; CI hasn't re-run on the change yet. **Cause:** The Playwright tests all passed (210). The job failed in the "Run Checks" step because the API lint allows no warnings, and it found two: 1. `packages/api/routes/configRoutes.ts` was 402 lines, over the 400-line limit, after the watchdog settings helper was added. 2. In `packages/api/routes/configSettings.ts`, the function `extractSettingSaves` had a complexity of 21, over the limit of 20, after the watchdog settings check was added. **Fix (no change in behaviour):** - I moved `agentWatchdogSettingsResponse` from `configRoutes.ts` into `configRoutesSettings.ts`, next to the similar `reviewContextBudgetSettingsResponse`. `configRoutes.ts` now imports it from there. - I moved the final watchdog and escalation checks out of `extractSettingSaves` into a small helper, `extractTrailingSettingSaves`. Settings are still checked and saved in the same order. **Tests:** The tests for the settings routes, follow-up, usage tips and reasoning level all pass. To run these checks locally I had to install dependencies and build a few packages first. None of that shows up in the changes; only the three files above changed. PR: #2757 Comment by: @propr-dev[bot] (ID: 6013371259) Model: claude-opus-5-5
|
ℹ️ Analyzed the follow-up request by @github-actions[bot] Analysis SummaryI made no changes, because the branch already contains the fix for this failure. The failed run (37441571757) tested the merge commit
To check, I installed dependencies and ran the API lint on the current branch. CI hasn't run on No preview was needed, since nothing changed that a user would see. No code changes were necessary based on the current state of the branch. 🤖 Analysis Details
💡 ProPR Slash Commands
🤖 Generated by ProPR |
AI Implementation Summary
Closes #2735
Branch:
2735/claude-opus-5-5-add-a-stall-and-degenerat-20261005-2330-eo3Commits: ✅ Changes committed (d809ddc)
AI Processing Completed
Execution Details:
Summary:
I've added the watchdog for issue #2735. A running agent that goes silent, or that only emits whitespace, is now stopped instead of holding its worker slot and capacity lease for up to 24 hours. Typecheck, lint and all the affected test suites pass. Two suites didn't run (see the end).
How it works
dockerExecutionWatchdog.ts,agentActivityWatchdog.ts), not in any agent's parser. It covers Claude, Codex, Antigravity, OpenCode and Vibe.AGENT_STALL_TIMEOUT_MS(default 10 min) stops the run.AGENT_TOOL_STALL_TIMEOUT_MS(default 30 min). A tool that keeps printing never trips it.AGENT_DEGENERATE_OUTPUT_LIMIT(default 50) consecutive whitespace-only deltas stop the run. Empty deltas don't count, and real text resets the count.0disables a rule. For the tool limit,0means a running tool call is never cut off.stalled/degenerate_output, and the task ends with matching newterminalReasonvalues. The stop happens at most once, and an outcome that is already in progress (deadline, user cancel, lost ownership) wins.propr setting update …and MCPupdate_execution_settings. They are read at the start of each run, so no restart is needed. The env var is the default,null/"default"clears the override, and invalid values fall back to the default with a warning.GET /api/llm-metricsnow has a per-rulewatchdogTripscount.terminalReason, so a watchdog-stopped task stays terminal rather than being treated as orphaned.Things to know
src/jobs/agentTerminalReason.tsrather than@propr/core. Several existing tests mock@propr/corewith a fixed export list, and a new core export broke them.agent_watchdog_defaultsandagent_watchdog_effective. I updated the four exact-matchgetSettingsexpectations intest/configRoutes.followup.test.tsto include them.Tests
stalled/degenerate_outputtask isn't re-marked orphanedtscis clean for the repo and the CLI. The UI's only errors are two existing ones from the unbuilt CLI package. Lint shows no errors. About 40 affected suites pass, including the full Settings UI suite (136 tests).test/llmMetrics.test.tsproduced no result in this environment; it probably needs a Redis server, which isn't installed here.packages/api/test/notificationProjectionService.test.tsfailed until I builtbetter-sqlite3's native module and rebuilt core, then passed. That was a sandbox setup problem, not a code issue.Docs are updated in
worker.md(the "No inactivity timeout" line is replaced by a watchdog section),execution-safety.md, the configuration reference, the regenerated settings-locations page,metrics.md, the CLI docs and the CHANGELOG. I captured a screenshot of the new Settings section for the PR.Detailed Logs:
74ac3f77-2455-4a8b-83d7-6f2a619e77c3Log files stored at:
/tmp/claude-logs/issue-2735-2026-10-06T00-13-44-244Z-conversation.json/tmp/claude-logs/issue-2735-2026-10-06T00-13-44-244Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #2735.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Agent watchdog settings
New Settings → Automation → Agent watchdog section: a stall timeout override (15 minutes) and empty fields showing the environment defaults as placeholders
Original unavailable: managed storage is unavailable or the upload has expired.