Skip to content

[2806 by Claude Opus 5.5] Agents v1 (7/17): Report-run executor — spawn an isolated task run from a definition and store the free-form report - #2839

Merged
propr-dev[bot] merged 11 commits into
2800-epic-agents-v1-y7tfrom
2806/claude-opus-5-5-agents-v1-7-17-report-run-20261006-1606-5i8
Oct 6, 2026
Merged

propr-dev[bot] merged 11 commits into
2800-epic-agents-v1-y7tfrom
2806/claude-opus-5-5-agents-v1-7-17-report-run-20261006-1606-5i8

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #2806

Branch: 2806/claude-opus-5-5-agents-v1-7-17-report-run-20261006-1606-5i8
Commits: ✅ Changes committed (c9ef18c)


AI Processing Completed

Execution Details:

Summary:
The run is still going; I'll pick it up when it reports back.

Detailed Logs:

  • Conversation: 125 messages
  • Session: d57a755b-bd88-4a3d-9f24-cba2704329ef

Log files stored at:

  • conversation: /tmp/claude-logs/issue-2806-2026-10-06T16-16-07-324Z-conversation.json
  • output: /tmp/claude-logs/issue-2806-2026-10-06T16-16-07-324Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: The run is still going; I'll pick it up when it reports back.


This PR was created automatically by ProPR after processing issue #2806.


💡 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!

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Oct 6, 2026
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on c9ef18c are holding the loop back:

  • Select PR check runners — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate Changes

Please investigate and fix this CI failure.

Failure evidence

.github:18
Process completed with exit code 1.

.github:369
Process completed with exit code 1.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Checks Failed

Validation failed during setup, tests, CLI packaging, linting, or build checks.

View Logs
Build check diagnostics for run 37494364429, attempt 1
Checkout outcome: success

--- GitHub Actions workflow lint ---

--- Release shell script lint ---

--- Toolchain ---
v22.23.3
10.9.9

--- Dependency installation ---
npm warn deprecated [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated [email protected]: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

added 1120 packages, and audited 1129 packages in 1m

323 packages are looking for funding
  run `npm fund` for details

9 high severity vulnerabilities

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.

--- CLI release package ---
Verifying propr-cli release package...

> [email protected] cli:pack
> node packages/cli/scripts/build-publish.mjs


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc


> @propr/[email protected] build
> tsc && node scripts/copy-assets.mjs

copy-assets: copied 9 file(s) into the CLI package.

Staged [email protected] at /var/lib/propr-ci/worker5/work/propr/propr/dist-publish/propr-cli
npm notice
npm notice package: [email protected]
npm notice Tarball Contents
npm notice 26.3kB README.md
npm notice 36.3kB dist/agentSkill.js
npm notice 754B dist/api/agentRuntime.js
npm notice 7.1kB dist/api/agents.js
npm notice 2.6kB dist/api/agentTank.js
npm notice 11.7kB dist/api/client.js
npm notice 5.0kB dist/api/errors.js
npm notice 16.6kB dist/api/goals.js
npm notice 5.6kB dist/api/implement.js
npm notice 2.4kB dist/api/index.js
npm notice 1.9kB dist/api/logs.js
npm notice 5.7kB dist/api/plans.js
npm notice 4.2kB dist/api/relay.js
npm notice 10.8kB dist/api/repos.js
npm notice 12.7kB dist/api/settings.js
npm notice 1.6kB dist/api/syntheticPools.js
npm notice 1.8kB dist/api/system.js
npm notice 5.8kB dist/api/tasks.js
npm notice 2.9kB dist/api/todos.js
npm notice 86B dist/api/types.js
npm notice 313B dist/api/visualPreviewAuth.js
npm notice 26.1kB dist/assets/env.example.txt
npm notice 5.7kB dist/auth/githubLogin.js
npm notice 19.4kB dist/commands/agentCommands.js
npm notice 4.2kB dist/commands/agentPoolCommands.js
npm notice 4.3kB dist/commands/agentSkillCommands.js
npm notice 29.5kB dist/commands/agentValidation.js
npm notice 66.6kB dist/commands/checkCommands.js
npm notice 8.9kB dist/commands/configCommands.js
npm notice 14.6kB dist/commands/connectCommand.js
npm notice 5.5kB dist/commands/githubAppApi.js
npm notice 27.7kB dist/commands/githubAppCommands.js
npm notice 57.9kB dist/commands/goalCommands.js
npm notice 2.4kB dist/commands/imageCommands.js
npm notice 8.0kB dist/commands/implementCommands.js
npm notice 1.7kB dist/commands/index.js
npm notice 7.2kB dist/commands/initCommands.js
npm notice 14.1kB dist/commands/initStack.js
npm notice 6.1kB dist/commands/logCommands.js
npm notice 24.9kB dist/commands/planCommands.js
npm notice 8.4kB dist/commands/relayCommands.js
npm notice 31.1kB dist/commands/repoCommands.js
npm notice 2.7kB dist/commands/repoValidate.js
npm notice 7.5kB dist/commands/runtimeCommands.js
npm notice 17.2kB dist/commands/settingCommands.js
npm notice 4.0kB dist/commands/setup/agentHostActions.js
npm notice 123B dist/commands/setup/agents.js
npm notice 4.5kB dist/commands/setup/engine.js
npm notice 51B dist/commands/setup/github.js
npm notice 15.3kB dist/commands/setup/hostActions.js
npm notice 27.3kB dist/commands/setup/sequential.js
npm notice 51B dist/commands/setup/state.js
npm notice 51B dist/commands/setup/types.js
npm notice 10.7kB dist/commands/setupCommand.js
npm notice 4.4kB dist/commands/stackCommands.js
npm notice 1.4kB dist/commands/startCommand.js
npm notice 13.5kB dist/commands/systemCommands.js
npm notice 3.5kB dist/commands/tankCommands.js
npm notice 45.1kB dist/commands/taskCommands.js
npm notice 29.6kB dist/commands/todoCommands.js
npm notice 31.0kB dist/commands/tunnelCommand.js
npm notice 2.7kB dist/commands/uiDocsCommands.js
npm notice 8.3kB dist/completion.js
npm notice 20.0kB dist/config/ConfigManager.js
npm notice 276B dist/config/index.js
npm notice 989B dist/config/rootKey.js
npm notice 345B dist/config/types.js
npm notice 42.9kB dist/connectIdentity.js
npm notice 25.0kB dist/connectRootAuthority.js
npm notice 32.5kB dist/connectWindowsAuthority.js
npm notice 2.2kB dist/desktopDiscovery.js
npm notice 12.4kB dist/desktopLocalSetup.js
npm notice 16.7kB dist/index.js
npm notice 4.5kB dist/native/darwin-authority-broker.c
npm notice 8.9kB dist/native/directory-operations.c
npm notice 50.1kB dist/native/prebuilds/darwin-arm64/connect-authority-broker
npm notice 54.2kB dist/native/prebuilds/darwin-arm64/directory-operations.node
npm notice 17.1kB dist/native/prebuilds/darwin-x64/connect-authority-broker
npm notice 24.3kB dist/native/prebuilds/darwin-x64/directory-operations.node
npm notice 28.9kB dist/native/prebuilds/linux-arm64/directory-operations.node
npm notice 17.4kB dist/native/prebuilds/linux-x64/directory-operations.node
npm notice 1.2kB dist/native/README.md
npm notice 3.1kB dist/orchestrator/format.js
npm notice 13.4kB dist/orchestrator/index.js
npm notice 302B dist/orchestrator/manifest.json
npm notice 119.1kB dist/orchestrator/orchestrator.mjs
npm notice 408B dist/orchestrator/types.js
npm notice 237B dist/skill/propr/agents/openai.yaml
npm notice 8.7kB dist/skill/propr/SKILL.md
npm notice 4.5kB dist/tui/AgentTableApp.js
npm notice 4.5kB dist/tui/app.js
npm notice 11.6kB dist/tui/CheckApp.js
npm notice 5.1kB dist/tui/render.js
npm notice 32.5kB dist/tui/SetupApp.js
npm notice 18.4kB dist/tui/SetupApp.test.js
npm notice 8.2kB dist/tui/StartApp.js
npm notice 3.6kB dist/utils/apiErrorPresentation.js
npm notice 12.0kB dist/utils/directoryDescriptor.js
npm notice 739B dist/utils/dockerPort.js
npm notice 5.0kB dist/utils/envFile.js
npm notice 520B dist/utils/index.js
npm notice 5.7kB dist/utils/io.js
npm notice 1.5kB dist/utils/nativeArtifact.js
npm notice 544B dist/utils/parseState.js
npm notice 417B dist/utils/positiveInteger.js
npm notice 4.5kB dist/utils/privateFilesystem.js
npm notice 4.2kB dist/utils/resolveProject.js
npm notice 7.2kB dist/vendor/local-setup/agents.js
npm notice 62.7kB dist/vendor/local-setup/engine.js
npm notice 5.0kB dist/vendor/local-setup/envFile.js
npm notice 9.1kB dist/vendor/local-setup/github.js
npm notice 188B dist/vendor/local-setup/index.js
npm notice 27.0kB dist/vendor/local-setup/publicInstanceIdentity.js
npm notice 14.6kB dist/vendor/local-setup/state.js
npm notice 2.8kB dist/vendor/local-setup/types.js
npm notice 1.0kB dist/vendor/shared/accountStatusTimestamp.js
npm notice 7.6kB dist/vendor/shared/activityEvents.js
npm notice 8.6kB dist/vendor/shared/agentDefinitions.js
npm notice 3.4kB dist/vendor/shared/agentLogin.js
npm notice 3.1kB dist/vendor/shared/agentTank.js
npm notice 1.8kB dist/vendor/shared/analyticsTimeframe.js
npm notice 2.0kB dist/vendor/shared/antigravityCompatibility.js
npm notice 5.1kB dist/vendor/shared/apiOrigin.js
npm notice 8.5kB dist/vendor/shared/connectDiscovery.js
npm notice 9.2kB dist/vendor/shared/cronSchedule.js
npm notice 254B dist/vendor/shared/demoMode.js
npm notice 4.3kB dist/vendor/shared/desktopPairing.js
npm notice 481B dist/vendor/shared/desktopTokenRevocation.js
npm notice 8.9kB dist/vendor/shared/events.js
npm notice 2.5kB dist/vendor/shared/githubAppManifest.js
npm notice 1.6kB dist/vendor/shared/githubAuthMode.js
npm notice 2.0kB dist/vendor/shared/githubEventIntakeMode.js
npm notice 11.6kB dist/vendor/shared/goalBlockers.js
npm notice 6.0kB dist/vendor/shared/goalCheckpoints.js
npm notice 4.0kB dist/vendor/shared/goalCreation.js
npm notice 4.9kB dist/vendor/shared/goalWait.js
npm notice 12.1kB dist/vendor/shared/index.js
npm notice 214B dist/vendor/shared/instanceAuthorization.js
npm notice 54B dist/vendor/shared/instanceCatalog.js
npm notice 4.0kB dist/vendor/shared/intakeModePrerequisites.js
npm notice 2.9kB dist/vendor/shared/labelUtils.js
npm notice 16.6kB dist/vendor/shared/modelDefinitions.js
npm notice 3.5kB dist/vendor/shared/notificationLinks.js
npm notice 51.3kB dist/vendor/shared/notifications.js
npm notice 866B dist/vendor/shared/projectSlug.js
npm notice 3.8kB dist/vendor/shared/proprCompatibility.js
npm notice 13.0kB dist/vendor/shared/proprServiceUrls.js
npm notice 16.6kB dist/vendor/shared/prTemplate.js
npm notice 2.2kB dist/vendor/shared/publishedVisualPreviews.js
npm notice 2.6kB dist/vendor/shared/reasoningLevels.js
npm notice 1.2kB dist/vendor/shared/repositoryIcon.js
npm notice 1.4kB dist/vendor/shared/repositoryIconUrl.js
npm notice 3.7kB dist/vendor/shared/repositoryPresentation.js
npm notice 9.5kB dist/vendor/shared/reviewContextBudget.js
npm notice 5.8kB dist/vendor/shared/reviewFeedbackIds.js
npm notice 1.7kB dist/vendor/shared/reviewPrompt.js
npm notice 907B dist/vendor/shared/runCostCap.js
npm notice 861B dist/vendor/shared/sessionSecret.js
npm notice 603B dist/vendor/shared/statusKeys.js
npm notice 7.5kB dist/vendor/shared/syntheticAgents.js
npm notice 2.2kB dist/vendor/shared/taskIdentifiers.js
npm notice 1.8kB dist/vendor/shared/taskLifecycle.js
npm notice 957B dist/vendor/shared/text.js
npm notice 5.6kB dist/vendor/shared/usageTips.js
npm notice 335B dist/vendor/shared/usageTypes.js
npm notice 1.1kB dist/vendor/shared/userWhitelist.js
npm notice 758B dist/vendor/shared/validateRelayUrl.js
npm notice 2.2kB dist/vendor/shared/validateRoutingUrl.js
npm notice 7.1kB dist/vendor/shared/visualPreviewCapacity.js
npm notice 9.3kB dist/vendor/shared/voice.js
npm notice 222B dist/vendor/shared/workEvidence.js
npm notice 622B package.json
npm notice Tarball Details
npm notice name: propr-cli
npm notice version: 0.9.0
npm notice filename: propr-cli-0.9.0.tgz
npm notice package size: 437.0 kB
npm notice unpacked size: 1.8 MB
npm notice shasum: 5e7d7b82810c5a2fd72dca262fd32bbce58c4990
npm notice integrity: sha512-xDVI0BXvCBRxW[...]fp6j/EBUR0+Tg==
npm notice total files: 172
npm notice
propr-cli-0.9.0.tgz

Dry run only. Re-run with --publish to publish to npm.
✅ propr-cli release package verified
Starting changed-area validation process...
Reusing this job's @propr/shared build from CLI packaging.
Reusing this job's @propr/local-setup build from CLI packaging.

--- Core Service: Lint & Build ---
❌ Core Lint FAILED

> [email protected] lint
> eslint src/ --max-warnings 0


/var/lib/propr-ci/worker5/work/propr/propr/src/jobs/agentRuns/workspace.ts
  92:8  warning  Async function 'copyAgentInputFiles' has too many parameters (5). Maximum allowed is 4  max-params

/var/lib/propr-ci/worker5/work/propr/propr/src/jobs/processAgentRunJob.ts
  158:12  warning  Async function 'processAgentRun' has a complexity of 25. Maximum allowed is 20  complexity

✖ 2 problems (0 errors, 2 warnings)

ESLint found too many warnings (maximum: 0).

--- API: Build & Lint ---
✅ API Build passed
✅ API Lint passed

--- Stage outcomes ---
Workflow lint: success
Release shell lint: success
Pre-setup gate: skipped
Node setup: success
Toolchain: success
Dependency install: success
Release metadata: success
CLI packaging: success
Change detection: success
Changed-area checks: failure

View Workflow

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 1465a01

Processed 2 comments:

  • Comment 1 by @propr-dev[bot] (ID: 6020576741✓)
  • Comment 2 by @github-actions[bot] (ID: 6020577591✓)

Summary of Changes

I fixed the two lint warnings that failed the Core Lint step of CI. npx eslint src/ --max-warnings 0 now passes with no warnings, npm run typecheck is clean, and test/processAgentRunJob.test.ts passes. I didn't run the rest of the test suite. No previews, since nothing visible changed.

  • Too many parameters in copyAgentInputFiles (src/jobs/agentRuns/workspace.ts): the optional log and inputRoot arguments are now one options object, { log?, inputRoot? }. I updated the two calls in the same file and the two in test/processAgentRunJob.test.ts to match.
  • Complexity too high in processAgentRun (src/jobs/processAgentRunJob.ts): I moved three pieces out into small helpers without changing how a run behaves:
    • reportFromResult throws if the agent failed or gave an empty report, otherwise returns the report.
    • previousReportsFor fetches earlier reports only when the definition asks for them.
    • failRunningRun holds what used to be the catch block: it works out the failure reason (including the usage-limit case), marks the run failed, and marks the task failed.

🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot], @github-actions[bot]
  • Time: 2m 48s
  • Tokens: 217,058 (213,304 in / 3,754 out)
  • Cost: $0.29

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6020576741✓, 6020577591✓

…p of CI. `npx eslint src/ --max-warnings 0` now passes with no warnings, `npm run typecheck` is clean, and `test/processAgentRunJob.test.ts` passes. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed the two lint warnings that failed the Core Lint step of CI. `npx eslint src/ --max-warnings 0` now passes with no warnings, `npm run typecheck` is clean, and `test/processAgentRunJob.test.ts` passes. I didn't run the rest of the test suite. No previews, since nothing visible changed.

- **Too many parameters in `copyAgentInputFiles`** (`src/jobs/agentRuns/workspace.ts`): the optional `log` and `inputRoot` arguments are now one options object, `{ log?, inputRoot? }`. I updated the two calls in the same file and the two in `test/processAgentRunJob.test.ts` to match.
- **Complexity too high in `processAgentRun`** (`src/jobs/processAgentRunJob.ts`): I moved three pieces out into small helpers without changing how a run behaves:
  - `reportFromResult` throws if the agent failed or gave an empty report, otherwise returns the report.
  - `previousReportsFor` fetches earlier reports only when the definition asks for them.
  - `failRunningRun` holds what used to be the `catch` block: it works out the failure reason (including the usage-limit case), marks the run failed, and marks the task failed.

PR: #2839
Comment by: @propr-dev[bot] (ID: 6020576741)
Comment by: @github-actions[bot] (ID: 6020577591)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 1465a01 are holding the loop back:

  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished
  • Classify changed surfaces — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished
  • Classify changed surfaces — not finished
  • Select PR check runners — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, report persistence, and autonomy-based completion. It needs changes to handle interrupted execution and cancellation consistently.

✅ Guarded report persistence — The running → report_ready compare-and-set prevents a late result from restoring a cancelled run.

✅ Workspace cleanup — Preparation failures clean up acquired workspaces, and execution releases them in finally.

✅ Focused execution tests — Tests cover successful reports, invalid definitions, empty output, usage limits, and preservation of cancelled run state.

This review used static analysis of the supplied code; no commands were run. Current checks show 13 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Interrupted runs cannot recover

  • Required behavior: A claimed report run must reach a terminal state or remain recoverable after worker interruption.

  • Evidence: src/jobs/processAgentRunJob.ts, processAgentRun initial state check and queued-to-running transition.

    1. A queued run is claimed successfully, persisting state: 'running' and its report task ID.
    2. The worker process terminates during the awaited workspace preparation or agent execution. Process termination bypasses the catch and finally blocks.
    3. When the interrupted queue job is delivered again, getRun returns the persisted running run.
    4. The initial run.state !== 'queued' branch returns status: 'skipped', acknowledging the delivery without resuming or terminating the run.

    The run remains running without an executing report job. The compare-and-set prevents duplicate claims but provides no recovery for an interrupted claim. The supplied tests exercise cancelled, skipped, and deferred pickup states, but not redelivery after a worker interruption. No external reconciliation implementation was supplied; the demonstrated defect is that this processor discards the recovery delivery.

    static trace: followed the persisted claim through process interruption and re-entry into the changed processor.

  • Minimum fix: Handle redelivery after a terminated attempt explicitly: recover execution or fail the abandoned run and task. Distinguish recovery from a delivery competing with a still-active attempt.

F2: 🔴 Late cancellation leaves an unfinished task

  • Required behavior: When report processing finishes after cancellation, its task receipt must reach a terminal state even if the cancellation endpoint could not stop the task.

  • Evidence: src/jobs/processAgentRunJob.ts, processAgentRun report-storage branch (if (!reported)).

    1. A report run is executing inside the awaited agent.executeTask(options).
    2. The cancellation endpoint transitions its run to cancelled. Its subsequent stopTask operation fails before stopping or updating the task; the supplied endpoint explicitly catches this failure and still returns the cancelled run.
    3. The agent subsequently returns a successful report. The processor updates the task to POST_PROCESSING.
    4. The guarded report transition returns null because the run is cancelled. The processor returns status: 'cancelled' and cleans up its workspace, without marking the task cancelled.

    The agent run is cancelled, but its Tasks UI receipt remains in post-processing after execution has ended. The run-state guard protects the report, not the task lifecycle. The existing cancellation test checks the run state and cleanup but never asserts a terminal task update.

    static trace: followed the supplied cancellation endpoint’s caught stop failure through the changed late-result branch.

  • Minimum fix: Reconcile the task to cancelled before returning from the rejected report-storage transition, preserving any terminal task state already established by cancellation.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Verify adapter policy enforcement

The new toolPolicy is outside the supplied shared AgentTaskOptions contract, and its comment explicitly defers enforcement. Add adapter-level integration coverage when implementing that enforcement: verify repository writes, GitHub mutations, and unavailable capabilities are actually denied. This is a follow-up because the supplied adapter implementations do not establish their current behavior; the existing source-string test only verifies that these two files do not name commit or push helpers.

Score

The main report path is well organized, but interruption recovery and cancellation leave lifecycle inconsistencies that require correction. Passing checks and focused tests provide useful evidence, while four suite shards remain pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 28s
  • Tokens: 52,591 (50,596 in / 1,995 out)
  • Cost: $0.50

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F1 F2 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 456bca3

Addressed 1 AI review comment (IDs: 6020738004)

Addressed findings F1, F2

Summary of Changes

I fixed both findings in src/jobs/processAgentRunJob.ts. The processor tests pass (20 of 20), and npm run typecheck and npx eslint src/ --max-warnings 0 are clean. Against the previous processor code, 4 of the 5 new tests fail. The fifth, for a duplicate delivery, passes either way because the old code skipped every non-queued run. I didn't run the rest of the test suite. No previews, since nothing visible changed.

F1 – interrupted runs. When a job is delivered again and its run is still running, the processor no longer ignores it:

  • Abandoned attempt: the queue only delivers an active job again after its lock has lapsed, so the earlier attempt is treated as dead. The run is moved from running to failed, with the reason "The worker running this report stopped before it finished; trigger the agent again", and the task is marked failed. I chose not to re-execute, because if the old attempt were in fact still running, the agent would run twice.
  • Attempt still running in this worker: the processor now tracks the runs it is executing. A delivery for one of those is skipped and leaves the run alone.
  • Run cancelled in the meantime: if the move to failed loses to a cancel, the task follows the run's actual state instead.

F2 – late cancellation. When storing the report is rejected because the run is no longer running, the processor now reads the run's current state. It marks the task cancelled (or failed, if the run was failed as abandoned) instead of leaving it in post-processing. The task store never overwrites a task that has already finished, so a task the cancel endpoint did stop keeps the state it was given.

The same mistake existed on the error path. If the run was cancelled and the agent then failed (for example, its container was killed), the task was marked failed while the run said cancelled. That path now checks the run's state the same way.

New tests cover:

  • a late report after a cancel the endpoint couldn't stop.
  • a cancel followed by an agent failure.
  • a delivery after an interrupted worker.
  • an abandoned run that is cancelled while being recovered.
  • a duplicate delivery while the run is still executing.

What this can't prevent:

  • A worker on another machine that froze long enough to lose its lock may still be running the agent when its run is failed. Its later result is then discarded and its task ends as failed, but its container isn't stopped from here.
  • The workspace of a worker that died isn't cleaned up. That was already the case and is outside these two findings.

The Gmail, Google Calendar and Google Drive connectors need to be authorized in claude.ai's connector settings before they can be used. I didn't need them for this.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 34s
  • Tokens: 668,559 (656,551 in / 12,008 out)
  • Cost: $0.65

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…The processor tests pass (20 of 20), and `npm run typecheck` and `npx eslint src/ --max-warnings 0` are clean. Against the previous processor code, 4 of the 5 new tests fail. The fifth, for a duplicate delivery, passes either way because the old code skipped every non-queued run. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed both findings in `src/jobs/processAgentRunJob.ts`. The processor tests pass (20 of 20), and `npm run typecheck` and `npx eslint src/ --max-warnings 0` are clean. Against the previous processor code, 4 of the 5 new tests fail. The fifth, for a duplicate delivery, passes either way because the old code skipped every non-queued run. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**F1 – interrupted runs.** When a job is delivered again and its run is still `running`, the processor no longer ignores it:
- **Abandoned attempt:** the queue only delivers an active job again after its lock has lapsed, so the earlier attempt is treated as dead. The run is moved from `running` to `failed`, with the reason "The worker running this report stopped before it finished; trigger the agent again", and the task is marked failed. I chose not to re-execute, because if the old attempt were in fact still running, the agent would run twice.
- **Attempt still running in this worker:** the processor now tracks the runs it is executing. A delivery for one of those is skipped and leaves the run alone.
- **Run cancelled in the meantime:** if the move to `failed` loses to a cancel, the task follows the run's actual state instead.

**F2 – late cancellation.** When storing the report is rejected because the run is no longer `running`, the processor now reads the run's current state. It marks the task cancelled (or failed, if the run was failed as abandoned) instead of leaving it in post-processing. The task store never overwrites a task that has already finished, so a task the cancel endpoint did stop keeps the state it was given.

The same mistake existed on the error path. If the run was cancelled and the agent then failed (for example, its container was killed), the task was marked failed while the run said cancelled. That path now checks the run's state the same way.

New tests cover:
- a late report after a cancel the endpoint couldn't stop.
- a cancel followed by an agent failure.
- a delivery after an interrupted worker.
- an abandoned run that is cancelled while being recovered.
- a duplicate delivery while the run is still executing.

**What this can't prevent:**
- A worker on another machine that froze long enough to lose its lock may still be running the agent when its run is failed. Its later result is then discarded and its task ends as failed, but its container isn't stopped from here.
- The workspace of a worker that died isn't cleaned up. That was already the case and is outside these two findings.

The Gmail, Google Calendar and Google Drive connectors need to be authorized in claude.ai's connector settings before they can be used. I didn't need them for this.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 456bca3 are holding the loop back:

  • Validate Changes — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR replaces the report-phase placeholder with workspace preparation, agent execution, report persistence, and task lifecycle handling. It needs changes before merge: interrupted finalization is not recoverable, failed persistence can be acknowledged as success, and attachment copying can follow repository-controlled symlinks outside the workspace.

✅ Guarded report storage — The running → report_ready compare-and-set prevents late results from overwriting a cancelled run.

✅ Focused lifecycle coverage — Tests cover execution failure, empty reports, usage limits, cancellation, duplicate delivery, and workspace cleanup.

The supplied checks show 13 passed, four pending, and no failures. This review uses static analysis of the supplied code; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F3: 🔴 Recover interrupted report finalization

  • Required behavior: A report-phase redelivery must finish durable lifecycle obligations without rerunning an already completed agent execution.

  • Evidence: src/jobs/processAgentRunJob.ts, processAgentRun entry-state guard and steps 9–10.

    1. A dry-run execution succeeds and transitionRun(..., 'report_ready', { report }) commits the report.
    2. The worker terminates after that awaited operation returns but before advanceAfterReport completes.
    3. BullMQ redelivers the interrupted job. The entry guard only recovers running; it skips this report_ready run.
    4. The dry run remains permanently report_ready, and its task remains in post-processing. Similarly, termination after advancement to completed but before markTaskCompleted leaves the task unfinished, and redelivery also skips it.

    The transitions and task completion are separate awaited operations, so process termination can occur between them. The compare-and-set protects report persistence but does not reconcile these subsequent obligations. activeRuns does not survive termination, and the supplied recovery tests cover only the running state. static trace: the entry guard and finalization sequence demonstrate both interruption windows.

  • Minimum fix: Add idempotent finalization on redelivery for runs whose report is already stored: advance eligible dry runs and settle their report tasks, including runs already marked completed. Preserve the intentional report_ready state for preview/auto runs while completing their report tasks.

F4: 🔴 Do not swallow failed state persistence

  • Required behavior: The processor must not acknowledge a failed run as durably settled when its failure transition could not be persisted.

  • Evidence: src/jobs/processAgentRunJob.ts, failRun, failRunningRun, and recoverAbandonedRun.

    1. An agent execution fails while its run is running.
    2. failRunningRun calls failRun, but the awaited database transition throws—for example, because its connection is temporarily unavailable.
    3. failRun logs the error and returns true, the same result used for a successfully persisted failure.
    4. The task failure update can succeed after the transient error, and the processor resolves with { status: 'failed' }. The run remains running, while the queue delivery has completed normally and provides no retry to repair it.

    The validation-failure and abandoned-run paths also consume this false success and resolve without persisting the intended terminal state. Catching errors from task updates does not restore the run transition. static trace: every caller treats the catch-path true as successful settlement; none schedules reconciliation.

  • Minimum fix: Propagate failure-transition persistence errors through the processor so the delivery can retry, keeping them distinct from a compare-and-set miss. Ensure the outer execution catch does not convert that persistence error back into a normally resolved result.

F5: 🔴 Prevent attachment writes outside the workspace

  • Required behavior: Preparing a repository workspace must not let repository-controlled paths redirect host-side attachment writes outside that workspace.

  • Evidence: src/jobs/agentRuns/workspace.ts, copyAgentInputFiles and its invocation from prepareRepositoryWorkspace.

    1. An enabled repository contains a tracked .propr/agent-inputs symlink pointing to /tmp, and a definition includes an attachment named notes.txt.
    2. Preparing the primary worktree checks out that symlink before calling copyAgentInputFiles.
    3. fs.ensureDir(targetDir) accepts the existing directory reached through the symlink.
    4. fs.copy(source, path.join(targetDir, fileName)) writes the attachment to /tmp/notes.txt, outside the workspace, potentially overwriting an existing writable file. Worktree cleanup leaves that external copy behind.

    The source-folder check constrains only the input path. safeFileName removes traversal from the filename but does not constrain symlink resolution in its destination ancestors. Runtime definition validation checks repository availability, not checked-out filesystem paths, and this copy happens on the host before agent execution. static trace: the unchecked destination path follows the checked-out symlink through ordinary filesystem resolution.

  • Minimum fix: Reject or safely replace symlinks in the reserved destination path before copying, and verify the destination resolves inside the workspace. Apply the same containment rule to the reserved context-repository destination.

Suggestions

These are optional follow-ups and are not sent to /fix.

S2: 🟢 Exercise real adapter boundaries

The processor tests mock agent execution, and the workspace tests exercise only the scratch path. A follow-up integration test using a repository worktree and a concrete adapter would strengthen confidence in workspace verification, Git access preparation, and report extraction. This is broader validation beyond the specific corrections above.

Score

The implementation has useful structure and focused tests, but durable lifecycle recovery and host filesystem containment need correction. Passing checks do not cover the demonstrated failure paths.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 14s
  • Tokens: 56,641 (54,819 in / 1,822 out)
  • Cost: $0.53

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F3 F4 F5 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 22a392c

Addressed 1 AI review comment (IDs: 6020931019)

Addressed findings F3, F4, F5

Summary of Changes

I fixed F3, F4 and F5. test/processAgentRunJob.test.ts and test/agentRunTrigger.test.ts pass (30 of 30). Root and packages/core typecheck are clean, and eslint reports no warnings on src/ or the changed core file. I added 10 regression tests, and all 10 fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

F3 – a redelivery now finishes a run whose report is already stored (src/jobs/processAgentRunJob.ts)

  • When a delivery arrives for a report_ready or completed run that already has a report, the processor finishes the remaining steps without running the agent again. A dry run is moved to completed. Preview and auto runs stay in report_ready. In both cases the report task is marked completed.
  • These steps are safe to repeat. A run that was already advanced isn't advanced again, and a task that already ended is left alone, so a duplicate delivery doesn't re-complete the task or send a second Inbox notification.
  • The normal path and redeliveries share this code. If finishing fails after the report is stored, the error is now thrown so the next delivery can finish the run. Before, that failure marked a run with a stored report as failed.
  • A delivery that overlaps a run still executing in the same process is skipped, as it already was for running.

F4 – a failure that can't be saved now fails the delivery

  • When saving the failed state to the database throws, the processor now raises a new AgentRunPersistenceError instead of treating the run as settled. This covers the validation-failure, execution-failure and abandoned-run paths. A run that another writer had already moved on still returns false as before, so the two cases stay separate.
  • That error is raised from inside the outer catch, so it is no longer turned into a normal { status: 'failed' } result. Workspace cleanup still runs.
  • One change outside the processor: AGENT_RUN_JOB_OPTIONS was attempts: 1, so a failed delivery would never be retried and these fixes would have nothing to act on. I changed it to attempts: 3 with exponential backoff (5 s) in packages/core/src/services/agents/agentRunTrigger.ts and updated its test. A retry doesn't spend tokens twice: after the run has started, a retry either fails it as abandoned or finishes it from the stored report. Please check you're happy with that change.

F5 – attachment and context-repo writes can't leave the workspace (src/jobs/agentRuns/workspace.ts)

  • A new prepareReservedDirectory checks the path from the workspace root down. Any symlink or file in the way, such as .propr itself, is unlinked; the place it points to is never touched. The final directory is always recreated empty, which also removes symlinks to individual files inside it. The function then confirms the directory really resolves inside the workspace.
  • copyAgentInputFiles uses it for .propr/agent-inputs. prepareRepositoryWorkspace uses it for .propr/context before cloning the additional repositories into it.

Other problems I found and left alone (outside the selected findings):

  • If marking the task failed or cancelled throws, the error is still swallowed. This happens in failRunningRun, recoverAbandonedRun and settleTaskWithRun. Once the run is failed or cancelled, a redelivery skips it, so the task can stay stuck in a processing state.
  • If an interrupted run is retried after all 3 attempts are used up and saving still fails, the run stays running. Retries can't fix that; it would need a separate background sweep.

🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 7m 1s
  • Tokens: 1,804,065 (1,778,447 in / 25,618 out)
  • Cost: $1.24

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…d `test/agentRunTrigger.test.ts` pass (30 of 30). Root and `packages/core` typecheck are clean, and eslint reports no warnings on `src/` or the changed core file. I added 10 regression tests, and all 10 fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed F3, F4 and F5. `test/processAgentRunJob.test.ts` and `test/agentRunTrigger.test.ts` pass (30 of 30). Root and `packages/core` typecheck are clean, and eslint reports no warnings on `src/` or the changed core file. I added 10 regression tests, and all 10 fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**F3 – a redelivery now finishes a run whose report is already stored** (`src/jobs/processAgentRunJob.ts`)
- When a delivery arrives for a `report_ready` or `completed` run that already has a report, the processor finishes the remaining steps without running the agent again. A dry run is moved to `completed`. Preview and auto runs stay in `report_ready`. In both cases the report task is marked completed.
- These steps are safe to repeat. A run that was already advanced isn't advanced again, and a task that already ended is left alone, so a duplicate delivery doesn't re-complete the task or send a second Inbox notification.
- The normal path and redeliveries share this code. If finishing fails after the report is stored, the error is now thrown so the next delivery can finish the run. Before, that failure marked a run with a stored report as `failed`.
- A delivery that overlaps a run still executing in the same process is skipped, as it already was for `running`.

**F4 – a failure that can't be saved now fails the delivery**
- When saving the `failed` state to the database throws, the processor now raises a new `AgentRunPersistenceError` instead of treating the run as settled. This covers the validation-failure, execution-failure and abandoned-run paths. A run that another writer had already moved on still returns `false` as before, so the two cases stay separate.
- That error is raised from inside the outer `catch`, so it is no longer turned into a normal `{ status: 'failed' }` result. Workspace cleanup still runs.
- **One change outside the processor:** `AGENT_RUN_JOB_OPTIONS` was `attempts: 1`, so a failed delivery would never be retried and these fixes would have nothing to act on. I changed it to `attempts: 3` with exponential backoff (5 s) in `packages/core/src/services/agents/agentRunTrigger.ts` and updated its test. A retry doesn't spend tokens twice: after the run has started, a retry either fails it as abandoned or finishes it from the stored report. Please check you're happy with that change.

**F5 – attachment and context-repo writes can't leave the workspace** (`src/jobs/agentRuns/workspace.ts`)
- A new `prepareReservedDirectory` checks the path from the workspace root down. Any symlink or file in the way, such as `.propr` itself, is unlinked; the place it points to is never touched. The final directory is always recreated empty, which also removes symlinks to individual files inside it. The function then confirms the directory really resolves inside the workspace.
- `copyAgentInputFiles` uses it for `.propr/agent-inputs`. `prepareRepositoryWorkspace` uses it for `.propr/context` before cloning the additional repositories into it.

**Other problems I found and left alone** (outside the selected findings):
- If marking the task failed or cancelled throws, the error is still swallowed. This happens in `failRunningRun`, `recoverAbandonedRun` and `settleTaskWithRun`. Once the run is `failed` or `cancelled`, a redelivery skips it, so the task can stay stuck in a processing state.
- If an interrupted run is retried after all 3 attempts are used up and saving still fails, the run stays `running`. Retries can't fix that; it would need a separate background sweep.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 22a392c are holding the loop back:

  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Connect Discovery and Darwin ACL (Node 22) — not finished
  • Validate Changes — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, task tracking, and recovery without rerunning an already claimed agent. It needs changes before merge because repository access restrictions, cancellation during preparation, and failed-task recovery remain incomplete.

✅ Recoverable report finalization — Once a report is stored, retries finish lifecycle updates without executing the agent again.

✅ Safer workspace writes — Reserved-directory preparation removes checked-out symlinks before copying inputs or cloning context repositories.

✅ Lifecycle coverage — Tests cover late results, provider failures, duplicate delivery, and interrupted report finalization.

The supplied current checks show no failures; four test shards remain pending. This review uses static tracing only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F6: 🔴 Enforce repository access at container launch

  • Required behavior: A run without repository_read must not receive repository source access.

  • Evidence: src/jobs/processAgentRunJob.ts, construction of options and agent.executeTask(options); src/jobs/agentRuns/workspace.ts, prepareScratchWorkspace.

    1. A valid Claude definition without repository_read starts on an installation with existing repository clones and no configured context-repository restriction.
    2. Workspace preparation creates an empty Git directory, and the processor passes toolPolicy to executeTask.
    3. The supplied Claude adapter does not consume toolPolicy; it calls prepareAgentGitAccess(options).
    4. That helper selects existing clones and builds their mounts when no context restriction exists, while also minting repository credentials.

    The resulting agent can access repository source despite its disabled capability. An empty working directory and prompt instructions do not remove those mounts or credentials. Runtime validation does not enforce container access, and the mocked execution tests inspect the option rather than its consumption. static trace: processor → supplied ClaudeAgent.executeTask → supplied prepareAgentGitAccess.

  • Minimum fix: Make the report execution path consume the capability policy before preparing credentials and mounts. Without repository_read, omit repository clone mounts and repository credentials; verify this through the actual adapter preparation path.

F7: 🔴 Cancellation during preparation still launches the agent

  • Required behavior: A cancelled report run must not subsequently start a new paid agent execution.

  • Evidence: src/jobs/processAgentRunJob.ts, preparation through agent.executeTask(options).

    1. The processor claims a run and awaits prepareWorkspace, which can perform repository cloning.
    2. During that await, the cancellation endpoint transitions the run to cancelled and invokes task stopping before an agent container exists.
    3. Preparation returns. The processor continues through prompt construction and agent resolution without checking cancellation.
    4. updateTaskState(...CLAUDE_EXECUTION) preserves an already-cancelled task, but its returned state is ignored. The processor then calls agent.executeTask.

    The cancelled run starts consuming provider resources; its report is only discarded afterward. Run compare-and-set protection prevents report resurrection but does not prevent execution. This ordering requires no expired queue lock: cancellation is explicitly permitted concurrently with preparation. static trace: changed processor, supplied cancellation endpoint, and supplied terminal-task preservation logic. The new cancellation test likewise allows execution after its harness changes the run to cancelled.

  • Minimum fix: Recheck run and task cancellation after preparation and immediately before launching execution, and return through cancellation settlement when stopped. Preserve the execution layer’s cancellation handling for cancellation concurrent with launch.

F8: 🔴 Failed runs can leave permanently active tasks

  • Required behavior: Recovery must settle the report task when its run has durably failed.

  • Evidence: src/jobs/processAgentRunJob.ts, failRunningRun, recoverAbandonedRun, settleTaskWithRun, and handleUnqueuedRun.

    1. An execution fails, and failRunningRun successfully persists the run as failed.
    2. The worker is interrupted before markTaskFailed, or that task update throws and its error is swallowed.
    3. After interruption, BullMQ redelivers the job. handleUnqueuedRun skips the already-failed run without reconciling its task. In the swallowed-error case, the original delivery resolves and requests no retry.

    The run remains failed while its task remains active. The same persistence gap exists in abandoned-run recovery, and settlement errors are also swallowed in settleTaskWithRun. Terminal-state preservation does not help because the affected task never reached a terminal state. static trace: the failure write precedes task settlement, while terminal failed runs have no recovery branch.

  • Minimum fix: Reconcile existing tasks for failed and cancelled runs on redelivery, and propagate settlement failures so retries can perform that reconciliation. Apply this consistently to ordinary failure, abandoned-run recovery, and cancellation settlement.

Suggestions

These are optional follow-ups and are not sent to /fix.

No suggestions.

Score

The implementation has useful recovery logic and substantial unit coverage, but the access-boundary and lifecycle defects require correction. Passing checks do not cover these demonstrated integration paths.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 48s
  • Tokens: 63,398 (61,982 in / 1,416 out)
  • Cost: $0.58

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F6 F7 F8

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b9b2271

Addressed 1 AI review comment (IDs: 6021175030)

Addressed findings F6, F7, F8

Summary of Changes

I fixed F6, F7 and F8. The agent-run tests and the agent git-access tests pass (6 files). Root and packages/core typecheck are clean, and eslint reports no warnings on src/ or the two changed core files. I added 14 regression tests; 12 of them fail when run against the previous source. The other 2 are guards that pass either way: one checks that a repository_read run still gets its credential, the other that an already-ended task is left alone. I didn't run the rest of the test suite. No previews, since nothing visible changed.

F6: repository access is now enforced when the container launches.

  • I added a repositoryAccess: 'none' option to AgentTaskOptions. When it's set, prepareAgentGitAccess returns an empty token and no mounts. It does this before it reads repository settings, mints a token or lists clones.
  • Every adapter (Claude, Codex, the Codex app server, OpenCode, Vibe, Antigravity) prepares its launch through that function. Their Docker argument builders keep an empty mount list as it is, so no adapter falls back to the default clone mounts.
  • The processor sets the option, and passes an empty token, unless the run has repository_read and the workspace actually checked out a repository. That also covers a run with repository_read but no repositories, which gets an empty scratch directory.
  • The new core test sets up existing clones with no context restriction and checks that no token is minted and nothing is mounted.

F7: a run cancelled during preparation no longer starts the agent.

  • Right before executeTask, after the task is moved to execution, the processor re-reads the run.
    • If the run is no longer running, it settles the task to match and returns without launching.
    • If the task was stopped directly while the run is still running, it cancels the run and returns.
  • A cancel that lands during the launch itself is still left to the execution layer's existing handling.
  • The two existing "cancel during execution" tests used to cancel at claim time, so with this check they would never have reached the agent. They now cancel from inside the agent call, so they still test cancellation during execution.

F8: failed and cancelled runs no longer leave their task active.

  • If the task can't be updated to match the run, the delivery now fails with a new AgentRunSettlementError instead of logging and returning. This applies to ordinary failure, abandoned-run recovery and cancellation settlement, and BullMQ retries the delivery.
  • When a job is redelivered for a failed or cancelled run, the processor now ends a task that still exists and is not finished yet. If the task doesn't exist or has already ended, it skips as before.

toolPolicy is still passed through unchanged; the repository restriction comes from the new launch option, not from toolPolicy.

Separately, the Gmail, Google Calendar and Google Drive connectors in this session need authorization in your claude.ai connector settings; they weren't needed for this work.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 6m 17s
  • Tokens: 2,422,050 (2,401,540 in / 20,510 out)
  • Cost: $1.35

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…t-access tests pass (6 files). Root and `packages/core` typecheck are clean, and eslint reports no warnings on `src/` or the two changed core files. I added 14 regression tests; 12 of them fail when run against the previous source. The other 2 are guards that pass either way: one checks that a `repository_read` run still gets its credential, the other that an already-ended task is left alone. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed F6, F7 and F8. The agent-run tests and the agent git-access tests pass (6 files). Root and `packages/core` typecheck are clean, and eslint reports no warnings on `src/` or the two changed core files. I added 14 regression tests; 12 of them fail when run against the previous source. The other 2 are guards that pass either way: one checks that a `repository_read` run still gets its credential, the other that an already-ended task is left alone. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**F6: repository access is now enforced when the container launches.**
- I added a `repositoryAccess: 'none'` option to `AgentTaskOptions`. When it's set, `prepareAgentGitAccess` returns an empty token and no mounts. It does this before it reads repository settings, mints a token or lists clones.
- Every adapter (Claude, Codex, the Codex app server, OpenCode, Vibe, Antigravity) prepares its launch through that function. Their Docker argument builders keep an empty mount list as it is, so no adapter falls back to the default clone mounts.
- The processor sets the option, and passes an empty token, unless the run has `repository_read` *and* the workspace actually checked out a repository. That also covers a run with `repository_read` but no repositories, which gets an empty scratch directory.
- The new core test sets up existing clones with no context restriction and checks that no token is minted and nothing is mounted.

**F7: a run cancelled during preparation no longer starts the agent.**
- Right before `executeTask`, after the task is moved to execution, the processor re-reads the run.
  - If the run is no longer `running`, it settles the task to match and returns without launching.
  - If the task was stopped directly while the run is still `running`, it cancels the run and returns.
- A cancel that lands during the launch itself is still left to the execution layer's existing handling.
- The two existing "cancel during execution" tests used to cancel at claim time, so with this check they would never have reached the agent. They now cancel from inside the agent call, so they still test cancellation during execution.

**F8: failed and cancelled runs no longer leave their task active.**
- If the task can't be updated to match the run, the delivery now fails with a new `AgentRunSettlementError` instead of logging and returning. This applies to ordinary failure, abandoned-run recovery and cancellation settlement, and BullMQ retries the delivery.
- When a job is redelivered for a `failed` or `cancelled` run, the processor now ends a task that still exists and is not finished yet. If the task doesn't exist or has already ended, it skips as before.

`toolPolicy` is still passed through unchanged; the repository restriction comes from the new launch option, not from `toolPolicy`.

Separately, the Gmail, Google Calendar and Google Drive connectors in this session need authorization in your claude.ai connector settings; they weren't needed for this work.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on b9b2271 are holding the loop back:

  • Connect Discovery and Darwin ACL (Node 22) — not finished
  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Validate Changes — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, and recovery without re-executing an already claimed run. It needs changes before merge because two cancellation paths can leave the run and its task inconsistent.

✅ Recovery after report storage — Redelivery completes stored reports without invoking the agent again, with tests covering interrupted finalization.

✅ Workspace path protection — Reserved directories replace checked-out symlinks before host-side writes, with focused regression tests.

The supplied checks show no failures; four full-suite shards remain pending. This review is based on static analysis only, as requested.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F9: 🔴 Honor task cancellation during execution

  • Required behavior: Report runs advertised as cancellable through stopTaskExecution must preserve cancellation consistently across the task and run.

  • Evidence: src/jobs/processAgentRunJob.ts, stoppedBeforeLaunch, post-execution report persistence, and failRunningRun.

    1. A report reaches agent.executeTask(options) and the processor awaits its result.
    2. The user stops its task directly through the Tasks UI. The task becomes cancelled; this route does not perform the separate agent-run cancellation transition.
    3. If execution returns an unsuccessful result, failRunningRun changes the still-running agent run to failed. If execution returns a successful late result, the processor stores it and advances a dry run to completed.
    4. The task remains cancelled because WorkerStateManager protects terminal cancellation. The associated run consequently reports failure or completion despite the user's cancellation.

    The processor explicitly reconciles direct task cancellation before launch, but never repeats that check after the execution await or in its failure handler. Run-level cancellation tests exercise a different path by transitioning the run itself. static trace: verified against the supplied processor, tests, and terminal-state protections. proposed regression: cancel only the task during execution and exercise both successful and unsuccessful late results.

  • Minimum fix: Reconcile task cancellation into the running agent run after execution and before failure settlement, using guarded transitions, and discard results from a cancelled task.

F10: 🔴 Do not cancel the winning claimant's task

  • Required behavior: Losing a run's claim must not cancel the task belonging to the delivery that successfully claimed it.

  • Evidence: src/jobs/processAgentRunJob.ts, the queued → running claim and its if (!running) branch.

    1. Delivery A reads a queued run and is interrupted before claiming it, for example while awaiting validateDefinition.
    2. A stopped worker cannot renew its BullMQ lock. After stalled-job redelivery, delivery B reads the still-queued run, creates its deterministic report task, claims the run, and starts execution.
    3. Worker A resumes. Its task creation uses the same deterministic task ID, and its guarded queued → running transition correctly returns null because B already claimed the run.
    4. A interprets every unsuccessful claim as cancellation and calls markTaskCancelled on B's shared task. B can subsequently store a successful report, but task completion is rejected because the task is already terminally cancelled.

    The interruption, rather than a slow await alone, prevents lock renewal. The database guard protects the run claim but does not authorize A's subsequent task mutation. activeRuns is checked only when the initial read observes an unqueued run; it cannot protect this stale queued snapshot and is process-local. static trace: verified against the claim branch, deterministic task IDs, documented stalled-delivery recovery, and supplied terminal-state protections. The existing duplicate-delivery test starts its second delivery after the run is already running, so it misses this path.

  • Minimum fix: On claim failure, reread the run and reconcile only an actual terminal cancellation or failure. Leave a run and task claimed by another delivery untouched; do not route that live claimant through abandoned-run recovery.

Suggestions

These are optional follow-ups and are not sent to /fix.

S3: 🟢 Exercise actual adapter boundaries

The processor tests mock executeTask, while repository denial is tested separately at prepareAgentGitAccess. A focused adapter-level test would strengthen confidence that scratch workspaces launch successfully and preserve empty credentials and mount arguments through container construction. This is additional integration coverage, not a demonstrated blocker.

Score

The implementation has substantial lifecycle coverage, but direct cancellation and competing-claim handling still produce incorrect persistent state. No current check failures are reported, although the full-suite shards remain pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 30s
  • Tokens: 69,887 (67,841 in / 2,046 out)
  • Cost: $0.67

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F9 F10 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 1268ad5

Addressed 1 AI review comment (IDs: 6021436518)

Addressed findings F9, F10

Summary of Changes

I fixed F9 and F10 in src/jobs/processAgentRunJob.ts. The processor and trigger tests pass (65 of 65), root and packages/core typecheck are clean, and npx eslint src/ --max-warnings 0 reports nothing. I added 7 regression tests; 6 of them fail against the previous processor code. I didn't run the rest of the test suite. No previews, since nothing visible changed.

F9: stopping a task during execution. After executeTask returns, the processor now checks whether the task was stopped directly. If it was, the run moves from running to cancelled, and the result is thrown away whether it succeeded or failed. The failure path makes the same check before marking the run failed. If that check itself errors (say, Redis is down), it logs and still records the failure, so the run doesn't stay running. All of these moves are guarded: if another writer already changed the run, the task follows whatever that writer stored.

  • Same defect in recovery: a run whose worker died after its task was stopped used to be failed as abandoned. It is now cancelled.
  • Remaining gap: a stop that lands between this check and storing the report is not caught. Tasks and runs live in different stores, so the check can't be atomic, and a run that already has its report can't be moved to cancelled.

F10: losing the claim. When the queued → running claim fails, the processor now rereads the run.

  • If the run was cancelled or failed, the task is ended to match.
  • In any other state, another delivery has claimed the run, so this delivery returns skipped and leaves the run and its task alone. It no longer goes through abandoned-run recovery.

Tests:

  • One test for each F10 case: the stale delivery that loses the claim to a stalled-job redelivery (the claimant's task still completes), and a run failed before the claim.
  • For F9, a task stopped during execution followed by a successful result, a failed result, and a thrown error. Plus the abandoned-run case.
  • The guard that passes either way: when the task can't be read, the failure is still recorded.
  • I rewrote the existing "cancelled between pickup and start" test so the run is actually cancelled. It used to fake a claim that returned null while the run stayed queued, which now correctly counts as someone else's claim.

To keep the file within its lint limits (400 lines, complexity 20), I moved the run error classes and reportFromResult into a new src/jobs/agentRuns/runErrors.ts. The error classes are still exported from the processor. I also added a few small helpers in the processor.

Separately, the Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 6m 44s
  • Tokens: 1,957,213 (1,937,168 in / 20,045 out)
  • Cost: $1.13

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

… processor and trigger tests pass (65 of 65), root and `packages/core` typecheck are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 7 regression tests; 6 of them fail against the previous processor code. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed F9 and F10 in `src/jobs/processAgentRunJob.ts`. The processor and trigger tests pass (65 of 65), root and `packages/core` typecheck are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 7 regression tests; 6 of them fail against the previous processor code. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**F9: stopping a task during execution.** After `executeTask` returns, the processor now checks whether the task was stopped directly. If it was, the run moves from `running` to `cancelled`, and the result is thrown away whether it succeeded or failed. The failure path makes the same check before marking the run failed. If that check itself errors (say, Redis is down), it logs and still records the failure, so the run doesn't stay `running`. All of these moves are guarded: if another writer already changed the run, the task follows whatever that writer stored.

- **Same defect in recovery:** a run whose worker died after its task was stopped used to be failed as abandoned. It is now cancelled.
- **Remaining gap:** a stop that lands between this check and storing the report is not caught. Tasks and runs live in different stores, so the check can't be atomic, and a run that already has its report can't be moved to `cancelled`.

**F10: losing the claim.** When the `queued → running` claim fails, the processor now rereads the run.
- If the run was cancelled or failed, the task is ended to match.
- In any other state, another delivery has claimed the run, so this delivery returns `skipped` and leaves the run and its task alone. It no longer goes through abandoned-run recovery.

**Tests:**
- One test for each F10 case: the stale delivery that loses the claim to a stalled-job redelivery (the claimant's task still completes), and a run failed before the claim.
- For F9, a task stopped during execution followed by a successful result, a failed result, and a thrown error. Plus the abandoned-run case.
- The guard that passes either way: when the task can't be read, the failure is still recorded.
- I rewrote the existing "cancelled between pickup and start" test so the run is actually cancelled. It used to fake a claim that returned null while the run stayed `queued`, which now correctly counts as someone else's claim.

To keep the file within its lint limits (400 lines, complexity 20), I moved the run error classes and `reportFromResult` into a new `src/jobs/agentRuns/runErrors.ts`. The error classes are still exported from the processor. I also added a few small helpers in the processor.

Separately, the Gmail, Google Calendar and Google Drive connectors need to be authorized in your claude.ai connector settings before they can be used.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 1268ad5 are holding the loop back:

  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Connect Discovery and Darwin ACL (Node 22) — not finished
  • Validate Changes — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Full Test Suite Results

Validation failed during: Test shard (shard 1).

  • Docs site validation: skipped (classifier decision: false)
  • Shard coverage verification: success
  • Hosted native Electron units: skipped (classifier decision: false)
  • Shard 1/4: failed during Test shard in 481.4s on GitHub Actions 1000067993
    • test/processAgentRunJob.test.ts: timed out after 180000ms; process group terminated
  • Shard 2/4: passed in 425.8s on GitHub Actions 1000067992
  • Shard 3/4: passed in 721.0s on GitHub Actions 1000067994
  • Shard 4/4: passed in 278.2s on GitHub Actions 1000067991
View shard 1/4 output
...(truncated)

sts 3
# suites 0
# pass 3
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 853.608995
[171/176] passed test/webhookRepositoryFilter.test.ts in 0.9s

[172/176] test/worker.modelSpecific.test.ts
TAP version 13
# Subtest: Worker - Model-Specific Features
    # Subtest: addModelSpecificDelay generates consistent delays for same model
    ok 1 - addModelSpecificDelay generates consistent delays for same model
      ---
      duration_ms: 0.682882
      type: 'test'
      ...
    # Subtest: addModelSpecificDelay timing verification
    ok 2 - addModelSpecificDelay timing verification
      ---
      duration_ms: 595.364181
      type: 'test'
      ...
    # Subtest: addModelSpecificDelay handles edge cases
    ok 3 - addModelSpecificDelay handles edge cases
      ---
      duration_ms: 0.340605
      type: 'test'
      ...
    1..3
ok 1 - Worker - Model-Specific Features
  ---
  duration_ms: 597.201559
  type: 'suite'
  ...
# Subtest: Worker - Branch and Worktree Naming
    # Subtest: createWorktreeForIssue generates unique names with model and random string
    ok 1 - createWorktreeForIssue generates unique names with model and random string
      ---
      duration_ms: 0.526957
      type: 'test'
      ...
    # Subtest: createWorktreeForIssue handles different models uniquely
    ok 2 - createWorktreeForIssue handles different models uniquely
      ---
      duration_ms: 0.18534
      type: 'test'
      ...
    # Subtest: createWorktreeForIssue sanitizes issue titles correctly
    ok 3 - createWorktreeForIssue sanitizes issue titles correctly
      ---
      duration_ms: 0.129466
      type: 'test'
      ...
    # Subtest: worktree names include proper timestamp format
    ok 4 - worktree names include proper timestamp format
      ---
      duration_ms: 0.141614
      type: 'test'
      ...
    1..4
ok 2 - Worker - Branch and Worktree Naming
  ---
  duration_ms: 1.29636
  type: 'suite'
  ...
# Subtest: Worker - Model-Specific Job Processing
    # Subtest: processGitHubIssueJob uses modelName from job data
    ok 1 - processGitHubIssueJob uses modelName from job data
      ---
      duration_ms: 0.214464
      type: 'test'
      ...
    # Subtest: processGitHubIssueJob handles missing modelName gracefully
    ok 2 - processGitHubIssueJob handles missing modelName gracefully
      ---
      duration_ms: 0.107092
      type: 'test'
      ...
    1..2
ok 3 - Worker - Model-Specific Job Processing
  ---
  duration_ms: 0.493797
  type: 'suite'
  ...
# Subtest: Worker - Concurrent Execution Prevention
    # Subtest: different models get different delay times
    ok 1 - different models get different delay times
      ---
      duration_ms: 0.205491
      type: 'test'
      ...
    # Subtest: concurrent job simulation shows different timings
    ok 2 - concurrent job simulation shows different timings
      ---
      duration_ms: 124.652792
      type: 'test'
      ...
    1..2
ok 4 - Worker - Concurrent Execution Prevention
  ---
  duration_ms: 125.035371
  type: 'suite'
  ...
1..4
# tests 11
# suites 4
# pass 11
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 875.858597
[172/176] passed test/worker.modelSpecific.test.ts in 1.0s

[173/176] test/workerStateManager.test.ts
TAP version 13
# (node:41462) ExperimentalWarning: Module mocking is an experimental feature and might change at any time
# (Use `node --trace-warnings ...` to show where the warning was created)
# Subtest: createTaskState creates state with correct structure
ok 1 - createTaskState creates state with correct structure
  ---
  duration_ms: 1.558797
  type: 'test'
  ...
# Subtest: createTaskState stores state in Redis with TTL
ok 2 - createTaskState stores state in Redis with TTL
  ---
  duration_ms: 0.192071
  type: 'test'
  ...
# Subtest: createTaskState uses default TTL when not specified
ok 3 - createTaskState uses default TTL when not specified
  ---
  duration_ms: 0.124358
  type: 'test'
  ...
# Subtest: createTaskState inserts task into database
ok 4 - createTaskState inserts task into database
  ---
  duration_ms: 0.128194
  type: 'test'
  ...
# Subtest: createTaskState generates correlation ID when not provided
ok 5 - createTaskState generates correlation ID when not provided
  ---
  duration_ms: 0.107843
  type: 'test'
  ...
# Subtest: createTaskState publishes real-time event
ok 6 - createTaskState publishes real-time event
  ---
  duration_ms: 0.159371
  type: 'test'
  ...
# Subtest: createTaskState handles missing optional issueRef fields
ok 7 - createTaskState handles missing optional issueRef fields
  ---
  duration_ms: 0.114804
  type: 'test'
  ...
# Subtest: createTaskState sets correct initial history entry
ok 8 - createTaskState sets correct initial history entry
  ---
  duration_ms: 0.117067
  type: 'test'
  ...
# Subtest: createTaskState handles database error gracefully
ok 9 - createTaskState handles database error gracefully
  ---
  duration_ms: 0.303068
  type: 'test'
  ...
# Subtest: createTaskState generates unique task keys
ok 10 - createTaskState generates unique task keys
  ---
  duration_ms: 0.451763
  type: 'test'
  ...
# Subtest: createTaskState stores valid JSON in Redis
ok 11 - createTaskState stores valid JSON in Redis
  ---
  duration_ms: 0.265021
  type: 'test'
  ...
# Subtest: createTaskState uses correct repository format in database
ok 12 - createTaskState uses correct repository format in database
  ---
  duration_ms: 0.142886
  type: 'test'
  ...
# Subtest: createTaskStateIfAbsent preserves a state that became processing before the atomic create
ok 13 - createTaskStateIfAbsent preserves a state that became processing before the atomic create
  ---
  duration_ms: 0.569611
  type: 'test'
  ...
# Subtest: updateTaskState throws when task not found
ok 14 - updateTaskState throws when task not found
  ---
  duration_ms: 0.387757
  type: 'test'
  ...
# Subtest: updateTaskState transitions state and appends to history
ok 15 - updateTaskState transitions state and appends to history
  ---
  duration_ms: 1.182828
  type: 'test'
  ...
# Subtest: updateTaskState publishes real-time event
ok 16 - updateTaskState publishes real-time event
  ---
  duration_ms: 0.248475
  type: 'test'
  ...
# Subtest: updateTaskState increments attempts on retry
ok 17 - updateTaskState increments attempts on retry
  ---
  duration_ms: 0.181003
  type: 'test'
  ...
# Subtest: updateTaskState does not increment attempts when not a retry
ok 18 - updateTaskState does not increment attempts when not a retry
  ---
  duration_ms: 0.131599
  type: 'test'
  ...
# Subtest: updateTaskState stores error metadata
ok 19 - updateTaskState stores error metadata
  ---
  duration_ms: 0.175936
  type: 'test'
  ...
# Subtest: updateTaskState uses default error category when not specified
ok 20 - updateTaskState uses default error category when not specified
  ---
  duration_ms: 0.154053
  type: 'test'
  ...
# Subtest: updateTaskState stores worktreeInfo metadata
ok 21 - updateTaskState stores worktreeInfo metadata
  ---
  duration_ms: 0.189546
  type: 'test'
  ...
# Subtest: updateTaskState stores claudeResult metadata
ok 22 - updateTaskState stores claudeResult metadata
  ---
  duration_ms: 0.176076
  type: 'test'
  ...
# Subtest: updateTaskState stores prResult metadata
ok 23 - updateTaskState stores prResult metadata
  ---
  duration_ms: 0.258281
  type: 'test'
  ...
# Subtest: updateTaskState persists to Redis with TTL renewal
ok 24 - updateTaskState persists to Redis with TTL renewal
  ---
  duration_ms: 0.19849
  type: 'test'
  ...
# Subtest: updateTaskState inserts history record into database
ok 25 - updateTaskState inserts history record into database
  ---
  duration_ms: 0.176587
  type: 'test'
  ...
# Subtest: updateTaskState uses default reason when not provided
ok 26 - updateTaskState uses default reason when not provided
  ---
  duration_ms: 0.151449
  type: 'test'
  ...
# Subtest: updateTaskState stores historyMetadata in history entry
ok 27 - updateTaskState stores historyMetadata in history entry
  ---
  duration_ms: 0.156136
  type: 'test'
  ...
# Subtest: updateTaskState handles database error gracefully
ok 28 - updateTaskState handles database error gracefully
  ---
  duration_ms: 0.170107
  type: 'test'
  ...
# Subtest: updateTaskState includes commitHash in database metadata
ok 29 - updateTaskState includes commitHash in database metadata
  ---
  duration_ms: 0.175405
  type: 'test'
  ...
# Subtest: markTaskFailed sets state to FAILED
ok 30 - markTaskFailed sets state to FAILED
  ---
  duration_ms: 0.207103
  type: 'test'
  ...
# Subtest: markTaskFailed stores error message in lastError
ok 31 - markTaskFailed stores error message in lastError
  ---
  duration_ms: 0.244479
  type: 'test'
  ...
# Subtest: markTaskFailed defaults errorCategory to unknown when not specified
ok 32 - markTaskFailed defaults errorCategory to unknown when not specified
  ---
  duration_ms: 0.193232
  type: 'test'
  ...
# Subtest: markTaskFailed uses provided errorCategory from metadata
ok 33 - markTaskFailed uses provided errorCategory from metadata
  ---
  duration_ms: 0.171309
  type: 'test'
  ...
# Subtest: markTaskFailed sets appropriate failure reason
ok 34 - markTaskFailed sets appropriate failure reason
  ---
  duration_ms: 0.155114
  type: 'test'
  ...
# Subtest: markTaskFailed appends failure to history
ok 35 - markTaskFailed appends failure to history
  ---
  duration_ms: 0.164559
  type: 'test'
  ...
# Subtest: markTaskFailed preserves additional metadata
ok 36 - markTaskFailed preserves additional metadata
  ---
  duration_ms: 0.204269
  type: 'test'
  ...
# Subtest: markTaskFailed publishes real-time event
ok 37 - markTaskFailed publishes real-time event
  ---
  duration_ms: 0.214545
  type: 'test'
  ...
# Subtest: markTaskFailed persists failure to Redis
ok 38 - markTaskFailed persists failure to Redis
  ---
  duration_ms: 0.205421
  type: 'test'
  ...
# Subtest: markTaskFailed inserts failure record into database
ok 39 - markTaskFailed inserts failure record into database
  ---
  duration_ms: 0.26506
  type: 'test'
  ...
# Subtest: markTaskFailed throws when task not found
ok 40 - markTaskFailed throws when task not found
  ---
  duration_ms: 0.151559
  type: 'test'
  ...
# Subtest: markTaskFailed handles different error categories
ok 41 - markTaskFailed handles different error categories
  ---
  duration_ms: 0.622171
  type: 'test'
  ...
# Subtest: markTaskFailed updates timestamp in lastError
ok 42 - markTaskFailed updates timestamp in lastError
  ---
  duration_ms: 0.213893
  type: 'test'
  ...
# Subtest: getResumableTask returns null when task not found
ok 43 - getResumableTask returns null when task not found
  ---
  duration_ms: 0.128324
  type: 'test'
  ...
# Subtest: getResumableTask returns null for COMPLETED state
ok 44 - getResumableTask returns null for COMPLETED state
  ---
  duration_ms: 0.131729
  type: 'test'
  ...
# Subtest: getResumableTask returns null for PENDING state
ok 45 - getResumableTask returns null for PENDING state
  ---
  duration_ms: 0.100051
  type: 'test'
  ...
# Subtest: getResumableTask returns null for FAILED state
ok 46 - getResumableTask returns null for FAILED state
  ---
  duration_ms: 0.100933
  type: 'test'
  ...
# Subtest: getResumableTask returns null for CANCELLED state
ok 47 - getResumableTask returns null for CANCELLED state
  ---
  duration_ms: 0.126852
  type: 'test'
  ...
# Subtest: getResumableTask returns task in PROCESSING state for recovery
ok 48 - getResumableTask returns task in PROCESSING state for recovery
  ---
  duration_ms: 0.098058
  type: 'test'
  ...
# Subtest: getResumableTask returns task in CLAUDE_EXECUTION state
ok 49 - getResumableTask returns task in CLAUDE_EXECUTION state
  ---
  duration_ms: 0.096055
  type: 'test'
  ...
# Subtest: getResumableTask returns task in POST_PROCESSING state
ok 50 - getResumableTask returns task in POST_PROCESSING state
  ---
  duration_ms: 0.091178
  type: 'test'
  ...
# Subtest: getResumableTask marks task as stale if updated more than 30 minutes ago
ok 51 - getResumableTask marks task as stale if updated more than 30 minutes ago
  ---
  duration_ms: 0.112891
  type: 'test'
  ...
# Subtest: getResumableTask returns isStale=false for recently updated tasks
ok 52 - getResumableTask returns isStale=false for recently updated tasks
  ---
  duration_ms: 0.13882
  type: 'test'
  ...
# Subtest: getResumableTask logs warning for stale tasks
ok 53 - getResumableTask logs warning for stale tasks
  ---
  duration_ms: 0.132551
  type: 'test'
  ...
# Subtest: getResumableTask returns correct staleDuration for stale tasks
ok 54 - getResumableTask returns correct staleDuration for stale tasks
  ---
  duration_ms: 0.143236
  type: 'test'
  ...
# Subtest: getResumableTask does not return staleDuration for non-stale tasks
ok 55 - getResumableTask does not return staleDuration for non-stale tasks
  ---
  duration_ms: 0.140692
  type: 'test'
  ...
# Subtest: getResumableTask preserves all task state data
ok 56 - getResumableTask preserves all task state data
  ---
  duration_ms: 0.14575
  type: 'test'
  ...
# Subtest: getResumableTask handles task at exactly 30 minute threshold
ok 57 - getResumableTask handles task at exactly 30 minute threshold
  ---
  duration_ms: 0.098198
  type: 'test'
  ...
# Subtest: getResumableTask does not log warning for non-stale tasks
ok 58 - getResumableTask does not log warning for non-stale tasks
  ---
  duration_ms: 0.086611
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes tasks older than maxAge
ok 59 - cleanupOldTasks removes tasks older than maxAge
  ---
  duration_ms: 0.221826
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips tasks within maxAge
ok 60 - cleanupOldTasks skips tasks within maxAge
  ---
  duration_ms: 0.122736
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips PROCESSING state tasks even if old
ok 61 - cleanupOldTasks skips PROCESSING state tasks even if old
  ---
  duration_ms: 0.095394
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips PENDING state tasks even if old
ok 62 - cleanupOldTasks skips PENDING state tasks even if old
  ---
  duration_ms: 0.093221
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips CLAUDE_EXECUTION state tasks even if old
ok 63 - cleanupOldTasks skips CLAUDE_EXECUTION state tasks even if old
  ---
  duration_ms: 0.114233
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips POST_PROCESSING state tasks even if old
ok 64 - cleanupOldTasks skips POST_PROCESSING state tasks even if old
  ---
  duration_ms: 0.134794
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes old FAILED tasks
ok 65 - cleanupOldTasks removes old FAILED tasks
  ---
  duration_ms: 0.135745
  type: 'test'
  ...
# Subtest: cleanupOldTasks removes old CANCELLED tasks
ok 66 - cleanupOldTasks removes old CANCELLED tasks
  ---
  duration_ms: 0.109926
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles corrupted JSON gracefully
ok 67 - cleanupOldTasks handles corrupted JSON gracefully
  ---
  duration_ms: 0.149876
  type: 'test'
  ...
# Subtest: cleanupOldTasks uses custom maxAge parameter
ok 68 - cleanupOldTasks uses custom maxAge parameter
  ---
  duration_ms: 0.114853
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips task when maxAge is longer than task age
ok 69 - cleanupOldTasks skips task when maxAge is longer than task age
  ---
  duration_ms: 0.096216
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles multiple tasks with mixed states and ages
ok 70 - cleanupOldTasks handles multiple tasks with mixed states and ages
  ---
  duration_ms: 0.160402
  type: 'test'
  ...
# Subtest: cleanupOldTasks returns 0 when no keys exist
ok 71 - cleanupOldTasks returns 0 when no keys exist
  ---
  duration_ms: 0.071678
  type: 'test'
  ...
# Subtest: cleanupOldTasks skips keys with null values
ok 72 - cleanupOldTasks skips keys with null values
  ---
  duration_ms: 0.073662
  type: 'test'
  ...
# Subtest: cleanupOldTasks logs debug message for each cleaned task
ok 73 - cleanupOldTasks logs debug message for each cleaned task
  ---
  duration_ms: 0.118689
  type: 'test'
  ...
# Subtest: cleanupOldTasks logs info message with summary
ok 74 - cleanupOldTasks logs info message with summary
  ---
  duration_ms: 0.111829
  type: 'test'
  ...
# Subtest: cleanupOldTasks uses key prefix pattern for searching
ok 75 - cleanupOldTasks uses key prefix pattern for searching
  ---
  duration_ms: 0.087091
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles Redis errors during delete gracefully
ok 76 - cleanupOldTasks handles Redis errors during delete gracefully
  ---
  duration_ms: 0.146081
  type: 'test'
  ...
# Subtest: cleanupOldTasks determines age based on updatedAt not createdAt
ok 77 - cleanupOldTasks determines age based on updatedAt not createdAt
  ---
  duration_ms: 0.174264
  type: 'test'
  ...
# Subtest: cleanupOldTasks handles task at exactly maxAge boundary
ok 78 - cleanupOldTasks handles task at exactly maxAge boundary
  ---
  duration_ms: 0.187223
  type: 'test'
  ...
# Subtest: updateTaskStateIfCurrent atomically updates a matching task snapshot
ok 79 - updateTaskStateIfCurrent atomically updates a matching task snapshot
  ---
  duration_ms: 0.458413
  type: 'test'
  ...
# Subtest: updateTaskStateIfCurrent does not publish a lost compare-and-set race
ok 80 - updateTaskStateIfCurrent does not publish a lost compare-and-set race
  ---
  duration_ms: 0.286693
  type: 'test'
  ...
# Subtest: stale metadata updates retry without resurrecting a finalized task
ok 81 - stale metadata updates retry without resurrecting a finalized task
  ---
  duration_ms: 18.078051
  type: 'test'
  ...
# Subtest: ordinary state writers cannot move a terminal task back to processing
ok 82 - ordinary state writers cannot move a terminal task back to processing
  ---
  duration_ms: 0.346073
  type: 'test'
  ...
# Subtest: a retry writer that loses to cancellation cannot resurrect the task
ok 83 - a retry writer that loses to cancellation cannot resurrect the task
  ---
  duration_ms: 5.321074
  type: 'test'
  ...
# Subtest: terminal reasons persist in Redis, history, and task update events
ok 84 - terminal reasons persist in Redis, history, and task update events
  ---
  duration_ms: 5.364154
  type: 'test'
  ...
# Subtest: transport timeout errors do not claim the agent exceeded its overall time limit
ok 85 - transport timeout errors do not claim the agent exceeded its overall time limit
  ---
  duration_ms: 1.101365
  type: 'test'
  ...
# Subtest: requeued bookkeeping cancellation can resume the original task without losing its correlation
ok 86 - requeued bookkeeping cancellation can resume the original task without losing its correlation
  ---
  duration_ms: 0.484693
  type: 'test'
  ...
# Subtest: rescheduled bookkeeping cancellation can resume the original task without losing its correlation
ok 87 - rescheduled bookkeeping cancellation can resume the original task without losing its correlation
  ---
  duration_ms: 0.160512
  type: 'test'
  ...
# Subtest: closure cancellation losing a CAS race to a published PR result preserves successful post-processing
ok 88 - closure cancellation losing a CAS race to a published PR result preserves successful post-processing
  ---
  duration_ms: 4.708829
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {"status":"failed","prCreated":false}
ok 89 - closure cancellation accepts a retried task with no PR: {"status":"failed","prCreated":false}
  ---
  duration_ms: 0.471984
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {"status":"failed"}
ok 90 - closure cancellation accepts a retried task with no PR: {"status":"failed"}
  ---
  duration_ms: 0.15892
  type: 'test'
  ...
# Subtest: closure cancellation accepts a retried task with no PR: {}
ok 91 - closure cancellation accepts a retried task with no PR: {}
  ---
  duration_ms: 0.139872
  type: 'test'
  ...
# Subtest: a failed task records withdrawal only when its live queued retry was removed
ok 92 - a failed task records withdrawal only when its live queued retry was removed
  ---
  duration_ms: 0.377681
  type: 'test'
  ...
1..92
# tests 92
# suites 0
# pass 92
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 292.583399
[173/176] passed test/workerStateManager.test.ts in 0.4s

[174/176] test/workEvidenceMarker.test.ts
TAP version 13
# Subtest: work evidence marker
    # Subtest: builds stable, deduplicated evidence independent of visible comment copy
    ok 1 - builds stable, deduplicated evidence independent of visible comment copy
      ---
      duration_ms: 0.392223
      type: 'test'
      ...
    # Subtest: drops synthetic and invalid comment IDs
    ok 2 - drops synthetic and invalid comment IDs
      ---
      duration_ms: 0.074283
      type: 'test'
      ...
    1..2
ok 1 - work evidence marker
  ---
  duration_ms: 0.968485
  type: 'suite'
  ...
1..1
# tests 2
# suites 1
# pass 2
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 245.301407
[174/176] passed test/workEvidenceMarker.test.ts in 0.3s

[175/176] test/worktreeLifecycle.integration.test.ts
TAP version 13
# Subtest: Worktree Lifecycle Integration Tests
    # Subtest: Worktree Structure Creation
        # Subtest: creates worktree with proper directory structure
        ok 1 - creates worktree with proper directory structure
          ---
          duration_ms: 196.129749
          type: 'test'
          ...
        # Subtest: .git file exists in worktree (not a directory)
        ok 2 - .git file exists in worktree (not a directory)
          ---
          duration_ms: 185.853565
          type: 'test'
          ...
        # Subtest: .git file contains valid gitdir reference
        ok 3 - .git file contains valid gitdir reference
          ---
          duration_ms: 180.73113
          type: 'test'
          ...
        # Subtest: worktree creates unique directories for different issues
        ok 4 - worktree creates unique directories for different issues
          ---
          duration_ms: 187.338654
          type: 'test'
          ...
        # Subtest: worktree includes model suffix when model name provided
        ok 5 - worktree includes model suffix when model name provided
          ---
          duration_ms: 188.435303
          type: 'test'
          ...
        1..5
    ok 1 - Worktree Structure Creation
      ---
      duration_ms: 939.310554
      type: 'suite'
      ...
    # Subtest: Checkout Conflict Handling
        # Subtest: handles creating worktree when branch already exists locally
        ok 1 - handles creating worktree when branch already exists locally
          ---
          duration_ms: 233.251705
          type: 'test'
          ...
        # Subtest: handles creating worktree when directory already exists
        ok 2 - handles creating worktree when directory already exists
          ---
          duration_ms: 182.335596
          type: 'test'
          ...
        # Subtest: concurrent worktree creation for same issue with different models
        ok 3 - concurrent worktree creation for same issue with different models
          ---
          duration_ms: 194.482058
          type: 'test'
          ...
        # Subtest: worktree branch points to correct HEAD
        ok 4 - worktree branch points to correct HEAD
          ---
          duration_ms: 184.338704
          type: 'test'
          ...
        1..4
    ok 2 - Checkout Conflict Handling
      ---
      duration_ms: 794.859085
      type: 'suite'
      ...
    # Subtest: Worktree Cleanup
        # Subtest: worktree can be removed with git worktree remove
        ok 1 - worktree can be removed with git worktree remove
          ---
          duration_ms: 227.964757
          type: 'test'
          ...
        # Subtest: worktree directory can be cleaned via fs.remove
        ok 2 - worktree directory can be cleaned via fs.remove
          ---
          duration_ms: 180.729968
          type: 'test'
          ...
        # Subtest: associated branch can be deleted after worktree removal
        ok 3 - associated branch can be deleted after worktree removal
          ---
          duration_ms: 240.985914
          type: 'test'
          ...
        # Subtest: git worktree list reflects created and removed worktrees
        ok 4 - git worktree list reflects created and removed worktrees
          ---
          duration_ms: 239.893071
          type: 'test'
          ...
        1..4
    ok 3 - Worktree Cleanup
      ---
      duration_ms: 889.853774
      type: 'suite'
      ...
    # Subtest: Edge Cases
        # Subtest: handles special characters in issue title
        ok 1 - handles special characters in issue title
          ---
          duration_ms: 176.729931
          type: 'test'
          ...
        # Subtest: handles very long issue titles
        ok 2 - handles very long issue titles
          ---
          duration_ms: 178.407663
          type: 'test'
          ...
        # Subtest: worktree metadata exists in main repo .git/worktrees
        ok 3 - worktree metadata exists in main repo .git/worktrees
          ---
          duration_ms: 192.823055
          type: 'test'
          ...
        1..3
    ok 4 - Edge Cases
      ---
      duration_ms: 548.181163
      type: 'suite'
      ...
    # Subtest: Worktree Cleanup with Retention Strategies
        # Subtest: keep_on_failure strategy creates retention marker when success is false
        ok 1 - keep_on_failure strategy creates retention marker when success is false
          ---
          duration_ms: 177.869949
          type: 'test'
          ...
        # Subtest: keep_on_failure strategy removes worktree when success is true
        ok 2 - keep_on_failure strategy removes worktree when success is true
          ---
          duration_ms: 227.007752
          type: 'test'
          ...
        # Subtest: always_delete strategy removes worktree regardless of success
        ok 3 - always_delete strategy removes worktree regardless of success
          ---
          duration_ms: 226.641055
          type: 'test'
          ...
        # Subtest: keep_for_hours strategy creates marker and then removes worktree
        ok 4 - keep_for_hours strategy creates marker and then removes worktree
          ---
          duration_ms: 228.558137
          type: 'test'
          ...
        # Subtest: retention marker contains correct scheduled cleanup time
        ok 5 - retention marker contains correct scheduled cleanup time
          ---
          duration_ms: 177.326054
          type: 'test'
          ...
        1..5
    ok 5 - Worktree Cleanup with Retention Strategies
      ---
      duration_ms: 1037.72755
      type: 'suite'
      ...
    # Subtest: Expired Worktree Cleanup
        # Subtest: cleanupExpiredWorktrees removes worktrees past scheduled cleanup time
        ok 1 - cleanupExpiredWorktrees removes worktrees past scheduled cleanup time
          ---
          duration_ms: 177.160245
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees retains worktrees before scheduled cleanup time
        ok 2 - cleanupExpiredWorktrees retains worktrees before scheduled cleanup time
          ---
          duration_ms: 175.349356
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles multiple worktrees with mixed expiration
        ok 3 - cleanupExpiredWorktrees handles multiple worktrees with mixed expiration
          ---
          duration_ms: 182.633248
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles non-existent base path gracefully
        ok 4 - cleanupExpiredWorktrees handles non-existent base path gracefully
          ---
          duration_ms: 175.273856
          type: 'test'
          ...
        # Subtest: cleanupExpiredWorktrees handles corrupted retention info gracefully
        ok 5 - cleanupExpiredWorktrees handles corrupted retention info gracefully
          ---
          duration_ms: 177.237509
          type: 'test'
          ...
        1..5
    ok 6 - Expired Worktree Cleanup
      ---
      duration_ms: 887.943464
      type: 'suite'
      ...
    # Subtest: Safe Worktree Pruning
        # Subtest: detects and prunes stale metadata when worktree directory is missing
        ok 1 - detects and prunes stale metadata when worktree directory is missing
          ---
          duration_ms: 188.989663
          type: 'test'
          ...
        # Subtest: skips young stale entries that are below minimum age threshold
        ok 2 - skips young stale entries that are below minimum age threshold
          ---
          duration_ms: 177.579178
          type: 'test'
          ...
        # Subtest: handles non-existent .git/worktrees directory gracefully
        ok 3 - handles non-existent .git/worktrees directory gracefully
          ---
          duration_ms: 278.681896
          type: 'test'
          ...
        # Subtest: prunes entries without gitdir file when old enough
        ok 4 - prunes entries without gitdir file when old enough
          ---
          duration_ms: 177.562374
          type: 'test'
          ...
        # Subtest: skips entries without gitdir file when too young
        ok 5 - skips entries without gitdir file when too young
          ---
          duration_ms: 177.151913
          type: 'test'
          ...
        # Subtest: preserves valid worktree metadata for existing directories
        ok 6 - preserves valid worktree metadata for existing directories
          ---
          duration_ms: 177.068892
          type: 'test'
          ...
        # Subtest: handles mixed scenarios with valid, stale-old, and stale-young entries
        ok 7 - handles mixed scenarios with valid, stale-old, and stale-young entries
          ---
          duration_ms: 191.042351
          type: 'test'
          ...
        # Subtest: respects configurable minimum age threshold
        ok 8 - respects configurable minimum age threshold
          ---
          duration_ms: 185.198609
          type: 'test'
          ...
        1..8
    ok 7 - Safe Worktree Pruning
      ---
      duration_ms: 1553.809478
      type: 'suite'
      ...
    1..7
ok 1 - Worktree Lifecycle Integration Tests
  ---
  duration_ms: 6652.218145
  type: 'suite'
  ...
1..1
# tests 34
# suites 8
# pass 34
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 6922.884796
[175/176] passed test/worktreeLifecycle.integration.test.ts in 7.0s

[176/176] propr-ui#3/4 (workspace test script)

> [email protected] test
> vitest run --shard=3/4


�[1m�[30m�[46m RUN �[49m�[39m�[22m �[36mv5.0.0 �[39m�[90m/home/runner/work/propr/propr/propr-ui�[39m

 �[32m✓�[39m src/components/Dashboard.test.tsx �[2m(�[22m�[2m23 tests�[22m�[2m)�[22m�[33m 1273�[2mms�[22m�[39m
   �[32m✓�[39m Dashboard �[2m(23)�[22m
     �[33m�[2m✓�[22m�[39m filters completed work by title through the heading search box�[33m 324�[2mms�[22m�[39m
�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mshows the authenticated identity, installation types, and explicit recovery controls
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/hooks/useRepositoryManagement.test.tsx �[2m(�[22m�[2m26 tests�[22m�[2m)�[22m�[33m 2575�[2mms�[22m�[39m
�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mhands completion into pairing, authenticated reprobe, and the current dashboard flow
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mrequires a supported choice when a legacy saved setup used Demo mode
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/desktop/LocalSetupWizard.integration.test.tsx�[2m > �[22m�[2mproduction local setup journey�[2m > �[22m�[2mshows and confirms corrected WebSocket intake for stale ProPR Connect recovery
�[22m�[39mAn update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to LocalSetupWizard inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/desktop/LocalSetupWizard.integration.test.tsx �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[33m 872�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mclears the resolved base branch when branch lookup fails in new mode
�[22m�[39mFailed to load branches: Error: GitHub unavailable
    at �[90m/home/runner/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:246:43
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:1628:35
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2783:26
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3319:20
    at new Promise (<anonymous>)
    at runWithCancel (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3314:10)
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3299:20
    at new Promise (<anonymous>)
    at runWithTimeout (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3257:10)
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3876:64

�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mcontinues generation when persisting the resolved baseBranch fails after draft creation
�[22m�[39mFailed to persist draft setup snapshot: Error: Transient update failure
    at �[90m/home/runner/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:323:97
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:52
    at runWithSuite (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3248:8)
    at Object.collect (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:22)
    at Object.collect (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2768:51)
�[90m    at processTicksAndRejections (node:internal/process/task_queues:103:5)�[39m
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3449:26
    at collectTests (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3422:3)
    at startTests (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:4156:17)
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/base.BTS5G301.js:90:6

�[90mstderr�[2m | src/components/TaskPlanner/setupWizardHooks.test.tsx�[2m > �[22m�[2msetupWizardHooks branch resolution�[2m > �[22m�[2mpersists editable draft settings to context_config after debounce
�[22m�[39mFailed to persist draft settings: Error: Transient update failure
    at �[90m/home/runner/work/propr/propr/propr-ui/�[39msrc/components/TaskPlanner/setupWizardHooks.test.tsx:323:97
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:52
    at runWithSuite (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3248:8)
    at Object.collect (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2763:22)
    at Object.collect (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:2768:51)
�[90m    at processTicksAndRejections (node:internal/process/task_queues:103:5)�[39m
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3449:26
    at collectTests (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:3422:3)
    at startTests (file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/run.CQOUYP-x.js:4156:17)
    at file:///home/runner/work/propr/propr/node_modules/�[4mvitest�[24m/dist/chunks/base.BTS5G301.js:90:6

 �[32m✓�[39m src/components/TaskPlanner/setupWizardHooks.test.tsx �[2m(�[22m�[2m24 tests�[22m�[2m)�[22m�[32m 275�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/electronAdapters.test.ts �[2m(�[22m�[2m18 tests�[22m�[2m)�[22m�[32m 226�[2mms�[22m�[39m
�[90mstdout�[2m | src/components/TaskDetails/useTaskData.test.ts�[2m > �[22m�[2mtask detail history refreshes�[2m > �[22m�[2mturns the fixture baseline of three burst invalidations into one additional history request
�[22m�[39m[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }
[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }
[useTaskData] Received task update via WebSocket: { taskId: �[32m'task-1'�[39m, state: �[32m'processing'�[39m }

 �[32m✓�[39m src/components/TaskDetails/useTaskData.test.ts �[2m(�[22m�[2m23 tests�[22m�[2m)�[22m�[32m 41�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskPlanner/setupWizardHooks.persistence.test.tsx �[2m(�[22m�[2m10 tests�[22m�[2m)�[22m�[32m 38�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/ExecutionEventLog.test.tsx �[2m(�[22m�[2m20 tests�[22m�[2m)�[22m�[32m 225�[2mms�[22m�[39m
 �[32m✓�[39m src/components/ConnectPlusBanner.test.tsx �[2m(�[22m�[2m19 tests�[22m�[2m)�[22m�[33m 1549�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/DashboardSummary.test.tsx �[2m(�[22m�[2m14 tests�[22m�[2m)�[22m�[32m 300�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/McpLogsPage.test.tsx �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[33m 660�[2mms�[22m�[39m
 �[32m✓�[39m src/components/AgentTankSidebar.test.tsx �[2m(�[22m�[2m15 tests�[22m�[2m)�[22m�[33m 422�[2mms�[22m�[39m
�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2mfolds legacy models within each provider until requested
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2mshows Sonnet 5.5 as current and folds older Sonnet models
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/pages/SettingsPage/AgentsListSection.test.tsx�[2m > �[22m�[2mAgentsListSection web login�[2m > �[22m�[2moffers login for supported agents and opens their dialog
�[22m�[39mAn update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to AgentsListSection inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/pages/SettingsPage/AgentsListSection.test.tsx �[2m(�[22m�[2m11 tests�[22m�[2m)�[22m�[33m 510�[2mms�[22m�[39m
�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mapplies generation socket snapshots without refetching the draft
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'context'�[39m,
  status: �[32m'in_progress'�[39m,
  timestamp: �[32m'2026-05-05T00:00:05Z'�[39m,
  draftStatus: �[32m'generating'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mresyncs once when a socket event reports a terminal draft status
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'llm'�[39m,
  status: �[32m'completed'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'review'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2minstalls the next run ID before accepting its first socket snapshot
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  runId: �[32m'generation-run-2'�[39m,
  step: �[32m'context'�[39m,
  status: �[32m'in_progress'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'generating'�[39m,
  generationTrace: { runId: �[32m'generation-run-2'�[39m, steps: [ �[36m[Object]�[39m ] }
}

�[90mstdout�[2m | src/hooks/useDraft.test.tsx�[2m > �[22m�[2museDraft�[2m > �[22m�[2mapplies terminal draft status from the socket before the follow-up fetch resolves
�[22m�[39m[useDraft] Received draft update via WebSocket: {
  eventType: �[32m'draft:update'�[39m,
  draftId: �[32m'draft-1'�[39m,
  step: �[32m'complete'�[39m,
  status: �[32m'completed'�[39m,
  timestamp: �[32m'2026-05-05T00:00:10Z'�[39m,
  draftStatus: �[32m'review'�[39m,
  generationTrace: { steps: [ �[36m[Object]�[39m, �[36m[Object]�[39m, �[36m[Object]�[39m ] }
}

 �[32m✓�[39m src/hooks/useDraft.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 279�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/DesktopNotificationSettingsSection.test.tsx �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 286�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/index.embedded.test.tsx �[2m(�[22m�[2m8 tests�[22m�[2m)�[22m�[32m 237�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/HappeningNowSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[33m 403�[2mms�[22m�[39m
 �[32m✓�[39m src/components/GlobalSearch.palette.test.tsx �[2m(�[22m�[2m17 tests�[22m�[2m)�[22m�[33m 5726�[2mms�[22m�[39m
   �[32m✓�[39m GlobalSearch palette �[2m(17)�[22m
     �[33m�[2m✓�[22m�[39m shows full titles in one linear list grouped by type, with a live preview�[33m 462�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m walks the list with arrow keys, updating the preview, and opens the highlighted item on Enter�[33m 362�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m shows fresh plan and task timestamps as "just now", never "just now ago"�[33m 337�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m advertises the GitHub shortcut with the MacIntel modifier�[33m 321�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m advertises the GitHub shortcut with the Win32 modifier�[33m 324�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m advertises the GitHub shortcut with the Linux x86_64 modifier�[33m 320�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m cycles category scopes with Tab and filters the list�[33m 350�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m opens the highlighted task on GitHub with Cmd+Enter�[33m 327�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m previews a plan with its objective, the owner-stripped repo, and a status pill�[33m 330�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m caps and truncates a long repository name in the result row, keeping the full slug in a tooltip�[33m 316�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m shows a failure reason as a finding with the file path as code�[33m 324�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m closes when the backdrop is clicked�[33m 318�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m labels the footer link for the active scope�[33m 352�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m keeps a full plan search reachable from the All scope�[33m 319�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m runs the active scope's full search with Shift+Enter�[33m 321�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m opens the full plan search with Shift+Enter in the Plans scope�[33m 322�[2mms�[22m�[39m
     �[33m�[2m✓�[22m�[39m hangs the palette left-aligned under the search input�[33m 319�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2momits tab and requests for disabled/legacy repositories (false)
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2momits tab and requests for disabled/legacy repositories (undefined)
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/Repositories/RepoMediaPanel.test.tsx�[2m > �[22m�[2mrepository Media tab�[2m > �[22m�[2mclears media on repository change and disabling, ignoring stale requests
�[22m�[39mAn update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act
An update to RepoActionContainer inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/App.hostedFlow.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 916�[2mms�[22m�[39m
   �[32m✓�[39m HostedFlowRouteSync �[2m(5)�[22m
     �[33m�[2m✓�[22m�[39m preserves the validated active flow across actual React Router navigation without duplicating query parameters�[33m 701�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Repositories/RepoMediaPanel.test.tsx �[2m(�[22m�[2m12 tests�[22m�[2m)�[22m�[33m 684�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useLiveRefreshScheduler.test.tsx �[2m(�[22m�[2m7 tests�[22m�[2m)�[22m�[32m 23�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useHeaderStats.status.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 289�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/AddRepositoryModal.test.tsx�[2m > �[22m�[2mAddRepositoryModal�[2m > �[22m�[2mkeeps branch selection in the scroll-owned form and submits through one form path
�[22m�[39mIn HTML, <button> cannot be a descendant of <button>.
This will cause a hydration error.

  <AddRepositoryModal isOpen={true} newRepo="integry/propr" newAlias="Production" newBaseBranch="release/20..." ...>
    <div className="fixed inse..." onClick={function handleBackdropClick}>
      <div ref={{...}} role="dialog" aria-modal="true" aria-labelledby="_r_9_" tabIndex={-1} className="bg-white r...">
        <div>
        <form onSubmit={function handleSubmit} className="flex min-h...">
          <div data-testid="add-reposi..." className="min-h-0 fl...">
            <div>
            <div>
            <div>
              <label>
              <BaseBranchSelector repoName="integry/propr" value="release/20..." onChange={function Mock} ...>
                <div className="relative" ref={{...}}>
>                 <button
>                   id="_r_d_"
>                   type="button"
>                   onClick={function handleOpen}
>                   disabled={false}
>                   aria-labelledby="_r_e_ _r_h_"
>                   aria-describedby="_r_f_"
>                   aria-haspopup="listbox"
>                   aria-expanded={false}
>                   className="w-full px-3 py-2 text-left bg-white border border-gray-300 rounded-md font-mono text-sm..."
>                 >
                    <span>
                    <div className="flex items...">
>                     <button
>                       type="button"
>                       onClick={function handleClear}
>                       className="p-0.5 hover:bg-gray-200 rounded text-gray-400 hover:text-gray-600"
>                       title="Clear selection"
>                     >
                      ...
              ...
            ...
          ...

<button> cannot contain a nested <button>.
See this log for the ancestor stack trace.

 �[32m✓�[39m src/components/AddRepositoryModal.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[33m 314�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/VisualPreviewAuthSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 236�[2mms�[22m�[39m
 �[32m✓�[39m src/components/SummaryBrowser/index.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 102�[2mms�[22m�[39m
 �[32m✓�[39m src/components/SystemHealthPush.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[33m 408�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Goals/goalTimeline.test.ts �[2m(�[22m�[2m9 tests�[22m�[2m)�[22m�[32m 6�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/AccessManagementPage.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 209�[2mms�[22m�[39m
 �[32m✓�[39m src/api/apiClient.accounts.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 15�[2mms�[22m�[39m
 �[32m✓�[39m src/components/AgentChat/ModelSelector.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[33m 327�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/DesktopExperience.shortcut-readiness.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 163�[2mms�[22m�[39m
 �[32m✓�[39m src/api/compatibility.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 84�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskPlanner/PlanEditor.responsive.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 33�[2mms�[22m�[39m
 �[32m✓�[39m src/App.hostedCompletion.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 138�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/browserAdapters.test.ts �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 14�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/PushFailureDetails.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 161�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SummaryBrowserPage.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 39�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Analytics/activityAxis.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 22�[2mms�[22m�[39m
 �[32m✓�[39m src/components/Dashboard/workTitle.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 5�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/DesktopPresentationBoundary.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 173�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/AgentTankSection.test.tsx �[2m(�[22m�[2m6 tests�[22m�[2m)�[22m�[32m 145�[2mms�[22m�[39m
 �[32m✓�[39m src/api/usageTipsApi.test.ts �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 6�[2mms�[22m�[39m
 �[32m✓�[39m src/components/GlobalSearch.scrollbar.test.ts �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
�[90mstderr�[2m | src/pages/DesktopPairingPage.test.tsx�[2m > �[22m�[2mDesktopPairingPage�[2m > �[22m�[2mshows the server-provided client name and requires an explicit approval click
�[22m�[39mIn HTML, <div> cannot be a descendant of <p>.
This will cause a hydration error.

  <MemoryRouter initialEntries={[...]}>
    <Router basename={undefined} location={{pathname:"...", ...}} navigationType="POP" navigator={{index:0, ...}} ...>
      <AuthProvider user={{id:"101", ...}}>
        <DesktopPairingPage>
          <main className="flex min-h...">
            <section className="w-full max...">
              <img>
              <h1>
              <p>
>             <p className="mt-3 text-sm">
                <GitHubAccountIdentity account={{id:"101", ...}}>
                  <span className="inline-fle...">
                    <UserAvatar user={{id:"101", ...}} className="flex h-6 w..." fallbackClassName="bg-slate-1..." ...>
                      <AvatarFallback accessibleName="alice avatar" className="flex h-6 w..." ...>
>                       <div
>                         className="flex h-6 w-6 flex-none items-center justify-center rounded-full border border-sla..."
>                         aria-hidden={true}
>                       >
                    ...
              ...

<p> cannot contain a nested <div>.
See this log for the ancestor stack trace.

 �[32m✓�[39m src/pages/DesktopPairingPage.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 141�[2mms�[22m�[39m
 �[32m✓�[39m src/contexts/SystemStatusContext.push.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 21�[2mms�[22m�[39m
 �[32m✓�[39m src/desktop/PackagedAcceptanceLocalSetup.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 177�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useSystemReadiness.test.tsx �[2m(�[22m�[2m1 test�[22m�[2m)�[22m�[32m 27�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/ThinkingLog.test.tsx �[2m(�[22m�[2m4 tests�[22m�[2m)�[22m�[32m 134�[2mms�[22m�[39m
 �[32m✓�[39m src/components/RepositoryListItem.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 127�[2mms�[22m�[39m
�[90mstderr�[2m | src/hooks/useDecoratedRepoOptions.test.tsx�[2m > �[22m�[2museDecoratedRepoOptions�[2m > �[22m�[2mpasses through undefined options
�[22m�[39mAn update to TestComponent inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/hooks/useDecoratedRepoOptions.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 65�[2mms�[22m�[39m
 �[32m✓�[39m src/hooks/useAgentTankSuggestion.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 69�[2mms�[22m�[39m
�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mnames the selected repository without its owner
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mkeeps the owner when two owners share a repository name
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

�[90mstderr�[2m | src/components/TaskList/Filters.test.tsx�[2m > �[22m�[2mFilters�[2m > �[22m�[2mleaves the filter dropdowns to do the filtering, with no separate filter icon
�[22m�[39mAn update to RepoFilter inside a test was not wrapped in act(...).

When testing, code that causes React state updates should be wrapped into act(...):

act(() => {
  /* fire events that update state */
});
/* assert on the output */

This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act

 �[32m✓�[39m src/components/TaskList/Filters.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 159�[2mms�[22m�[39m
 �[32m✓�[39m src/components/TaskDetails/SectionLabelHeader.test.tsx �[2m(�[22m�[2m5 tests�[22m�[2m)�[22m�[32m 144�[2mms�[22m�[39m
 �[32m✓�[39m src/components/ActivitySparkline.test.tsx �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 105�[2mms�[22m�[39m
 �[32m✓�[39m src/pages/SettingsPage/UsageTipsSettingsSection.test.tsx �[2m(�[22m�[2m2 tests�[22m�[2m)�[22m�[32m 45�[2mms�[22m�[39m
 �[32m✓�[39m src/components/workflowSelectionInput.test.ts �[2m(�[22m�[2m3 tests�[22m�[2m)�[22m�[32m 4�[2mms�[22m�[39m
 �[32m✓�[39m src/utils/notificationIntents.test.ts �[2m(�[22m�[2m7 tests�[22m�[2m)�[22m�[32m 3�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m57 passed�[39m�[22m�[90m (57)�[39m
�[2m      Tests �[22m �[1m�[32m442 passed�[39m�[22m�[90m (442)�[39m
�[2m   Start at �[22m 17:26:13
�[2m   Duration �[22m 32.46s�[2m (environment 41%, tests 36%, import 9%, setup 8%, transform 5%)�[22m

�[2mEnvironment �[22m �[33mjsdom was created 57 times�[39m�[2m · 24.85s total, 41% of tracked time�[22m
�[2m            �[22m �[2mcreate it once per worker with �[22m�[33mpool: 'vmThreads'�[39m�[2m (keeps per-file isolation) or �[22m�[33misolate: false�[39m�[2m (shares it across files)�[22m
�[2m            �[22m �[2mlearn more: https://vitest.dev/guide/improving-performance#test-environments�[22m


> [email protected] posttest
> npm run test:docker-context


> [email protected] test:docker-context
> node --test scripts/docker-context-inputs.test.mjs

TAP version 13
# Subtest: focused UI selectors are forwarded only to Vitest
ok 1 - focused UI selectors are forwarded only to Vitest
  ---
  duration_ms: 0.507299
  type: 'test'
  ...
# Subtest: the UI Docker context contains its complete non-type external source import closure
ok 2 - the UI Docker context contains its complete non-type external source import closure
  ---
  duration_ms: 31.700441
  type: 'test'
  ...
1..2
# tests 2
# suites 0
# pass 2
# fail 0
# cancelled 0
# skipped 0
# todo 0
# duration_ms 69.610417
[176/176] passed propr-ui#3/4 (workspace test script) in 33.0s

### Shard 1/4: 175/176 passed in 481.4s

Assigned 176 of 702 discovered units.

| Duration | Status | Unit |
| ---: | --- | --- |
| 180.1s | failed | `test/processAgentRunJob.test.ts` |
| 57.3s | passed | `test/integrationImageHarness.test.mjs` |
| 33.0s | passed | `propr-ui#3/4` (workspace) |
| 7.5s | passed | `packages/api/test/mcpRecentActivity.test.ts` |
| 7.0s | passed | `test/worktreeLifecycle.integration.test.ts` |
| 6.6s | passed | `test/prContinuation.test.ts` |
| 6.4s | passed | `packages/api/test/mcpDeletePlan.test.ts` |
| 6.2s | passed | `apps/desktop/scripts/packaged-connect-journey.test.mjs` |
| 6.1s | passed | `test/agentRunTrigger.test.ts` |
| 5.4s | passed | `packages/api/test/mcpActivity.test.ts` |
| 4.9s | passed | `test/codexAppServerGoal.test.ts` |
| 4.9s | passed | `packages/cli/src/commands/initCommands.test.ts` |
| 4.5s | passed | `packages/api/test/liveOutputStream.test.ts` |
| 3.9s | passed | `test/reviewContextBudget.test.ts` |
| 3.8s | passed | `apps/desktop/scripts/published-preview-electron.test.mjs` |


1/176 test runs failed in shard 1/4 after 481.4s:
- test/processAgentRunJob.test.ts: timed out after 180000ms; process group terminated

Details truncated; see the uploaded artifacts for complete failure rows and logs.

View Workflow
View uploaded artifacts

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

This PR implements report execution, workspace preparation, task tracking, and recovery without rerunning a claimed agent. It needs changes before merge because cancellation can produce inconsistent terminal states, and repository-free runs unnecessarily depend on GitHub authentication.

✅ Recovery without repeat execution — Deliveries with stored reports finish lifecycle transitions without executing the agent again.

✅ Workspace destination protection — Reserved-directory preparation replaces checked-out symlinks before host-side writes, with targeted test coverage.

This review is a static trace of the supplied code; no commands were run. Current checks include 18 passes, one pending check, and a non-blocking shard failure.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F11: 🔴 Cancellation can become a completed run

  • Required behavior: A report task cancelled through the Tasks UI must discard its result and leave its agent run cancelled, rather than completed.

  • Evidence: src/jobs/processAgentRunJob.ts, processAgentRun steps 8–10 and finalizeReportedRun.

    1. A dry-run agent returns successfully, and followCancelledTask reads a task that is not cancelled.
    2. During the subsequent awaited updateTaskState(...POST_PROCESSING...), the Tasks UI cancellation persists the task as cancelled.
    3. The processor ignores the update's returned state and transitions the still-running agent run to report_ready.
    4. finalizeReportedRun advances the run to completed before reading the task. It then observes the terminal cancelled task and leaves it unchanged.

    The persistent result is a completed run with a published report and a cancelled report task. The supplied task-state compare-and-set protection preserves cancellation on the task, but does not guard the separate run transition. Queue retries do not repair this: recovery accepts the completed run and leaves terminal tasks unchanged.

    static trace: The cancellation endpoint for Tasks does not update the agent run, as documented by followCancelledTask; the awaited post-processing update creates a concrete unchecked window before report publication. No expired lease or duplicate delivery is needed.

  • Minimum fix: Check the post-processing update result, or reread task cancellation after that awaited update, before storing the report. Route observed cancellation through followCancelledTask. Add a regression that cancels during the post-processing update and asserts that no report is published.

F12: 🔴 Repository-free runs require GitHub authentication

  • Required behavior: Runs prepared without repository access must be able to execute without obtaining repository credentials.

  • Evidence: src/jobs/processAgentRunJob.ts, the unconditional deps.getGitHubAccess() call in processAgentRun.

    1. A valid definition has no repositories and no repository_read capability, with an available configured agent.
    2. Runtime validation accepts it without repository validation.
    3. After claiming the run, the processor unconditionally requests authenticated Octokit and an installation token.
    4. If installation authentication is unavailable, that call throws before scratch-workspace preparation or agent execution. The catch path permanently fails the run and task.

    A report needing only its prompt and input files therefore fails because of an unrelated GitHub authentication failure. The repositoryAccess: 'none' adapter bypass cannot prevent this because it is reached only after the unconditional authentication call succeeds.

    static trace: The supplied validation permits repository-free definitions, workspace preparation explicitly supports them, and the processor obtains GitHub access before selecting that workspace path.

  • Minimum fix: Obtain GitHub access only when repository_read is enabled and the definition contains repositories. Otherwise pass an empty token and no Octokit to scratch-workspace preparation. Test that such a run completes even when the GitHub-access dependency would throw.

Suggestions

These are optional follow-ups and are not sent to /fix.

S4: 🟢 Exercise real repository workspace preparation

The new tests cover scratch workspaces and reserved-directory handling, while processor tests mock repository preparation. A follow-up integration test using local repositories would strengthen coverage of primary worktree creation, additional clones, and cleanup. This is optional coverage beyond the concrete corrections above.

Score

The implementation has substantial lifecycle coverage and useful recovery safeguards, but the two execution-path defects need localized corrections before merge. Full-suite validation also remains unsettled.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 17s
  • Tokens: 72,102 (70,270 in / 1,832 out)
  • Cost: $0.68

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F11 F12 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 93449b0

Summary of Changes

I fixed the shard 1 timeout in test/processAgentRunJob.test.ts. The test file passes (48 of 48 in 2.4s) both normally and with a simulated CI sudo; I haven't confirmed it on a real CI runner yet.

Cause: the workspace test calls the real setup code, which runs sudo chown -R 1000:1000 on the scratch workspace. My local container has no sudo, so the call fails, the code logs a warning and the test finishes. GitHub runners have passwordless sudo, so there the chown succeeds. The test process then has to clean up a directory owned by another user, and the file hung until the 180s limit killed it. To reproduce this, I used a fake sudo that makes the workspace read-only, and the file hung the same way.

Fix (test-only):

  • At the top of the test file, I put a stub sudo that does nothing first on PATH. test/worktreeStartRevision.test.ts already handles the same problem this way.
  • The after hook now closes the database connection in a finally, so a failed cleanup can't keep the process alive.

With the fix, the file passes against both the fake read-only sudo and the normal environment. No other test calls this workspace setup. ESLint ignores files under test/, so lint doesn't cover this change. I didn't run the rest of the suite. Nothing visible changed, so there are no previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @github-actions[bot]
  • Time: 3m 40s
  • Tokens: 953,875 (949,867 in / 4,008 out)
  • Cost: $0.61
  • Subscription usage: Session +1%

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6021809239✓

…t.ts`. The test file passes (48 of 48 in 2.4s) both normally and with a simulated CI `sudo`; I haven't confirmed it on a real CI runner yet.

I fixed the shard 1 timeout in `test/processAgentRunJob.test.ts`. The test file passes (48 of 48 in 2.4s) both normally and with a simulated CI `sudo`; I haven't confirmed it on a real CI runner yet.

**Cause:** the workspace test calls the real setup code, which runs `sudo chown -R 1000:1000` on the scratch workspace. My local container has no `sudo`, so the call fails, the code logs a warning and the test finishes. GitHub runners have passwordless `sudo`, so there the chown succeeds. The test process then has to clean up a directory owned by another user, and the file hung until the 180s limit killed it. To reproduce this, I used a fake `sudo` that makes the workspace read-only, and the file hung the same way.

**Fix (test-only):**
- At the top of the test file, I put a stub `sudo` that does nothing first on `PATH`. `test/worktreeStartRevision.test.ts` already handles the same problem this way.
- The `after` hook now closes the database connection in a `finally`, so a failed cleanup can't keep the process alive.

With the fix, the file passes against both the fake read-only `sudo` and the normal environment. No other test calls this workspace setup. ESLint ignores files under `test/`, so lint doesn't cover this change. I didn't run the rest of the suite. Nothing visible changed, so there are no previews.

PR: #2839
Comment by: @github-actions[bot] (ID: 6021809239)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 9930901

Addressed 1 AI review comment (IDs: 6021842566)

Addressed findings F11, F12

Summary of Changes

I fixed F11 and F12. The processor and trigger tests pass (68 of 68), the root and packages/core typechecks are clean, and npx eslint src/ --max-warnings 0 reports nothing. I added 3 regression tests; the 2 that cover these bugs fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

F11 – a cancel during the "storing report" update no longer ends as a completed run

  • In src/jobs/processAgentRunJob.ts, after the POST_PROCESSING task update, the processor now reads the task again through followCancelledTask before storing the report. If the task was cancelled, the run is cancelled too and the report is dropped.
  • The check has to come before the report is stored: once a run has a stored report (report_ready), the run store won't let it become cancelled.
  • I looked for the same defect elsewhere. Every other point where the processor waits on something and then changes the run already re-checks for a cancelled task first. The recovery paths for runs with a stored report only pick up runs that already have one, so this check covers them as well.
  • A small gap remains between that read and storing the report. The tasks and the runs live in two separate stores, so a cancel landing in that moment can't be fully excluded. The unchecked wait on the update itself is gone.
  • Regression test: the task is cancelled during the POST_PROCESSING update. The test checks that the run ends cancelled with no report, is never marked report_ready or completed, the task stays cancelled, and the workspace is cleaned up.

F12 – runs that don't read repositories no longer need GitHub sign-in

  • I added definitionReadsRepositories() to src/jobs/agentRuns/workspace.ts: true only when the definition has repository_read and at least one repository.
  • The workspace setup, the GitHub sign-in and the agent's repository access now all use that same check. GitHub credentials are fetched only when it's true; otherwise the workspace gets an empty token and no GitHub client, and the agent launches without repository access.
  • Regression tests:
    • The GitHub-access step throws for three kinds of definition: no capability and no repositories, repositories but no repository_read, and repository_read with no repositories. In all three the run completes, GitHub access is never requested, and the agent gets no repository access.
    • A guard test checks that a run which does read repositories still fails cleanly when GitHub access fails.

Unrelated change: moving the GitHub-access decision into the processor took it over two eslint limits (function complexity and file length). To stay under them, I moved the agent launch options into a new src/jobs/agentRuns/agentTaskOptions.ts, along with the AgentRunToolPolicy type. processAgentRunJob.ts still exports that type, so existing imports keep working.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. I didn't need them for this.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 5m 52s
  • Tokens: 1,358,116 (1,347,111 in / 11,005 out)
  • Cost: $0.76
  • Subscription usage: Session +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…68 of 68), the root and `packages/core` typechecks are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 3 regression tests; the 2 that cover these bugs fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed F11 and F12. The processor and trigger tests pass (68 of 68), the root and `packages/core` typechecks are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 3 regression tests; the 2 that cover these bugs fail when run against the previous source. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**F11 – a cancel during the "storing report" update no longer ends as a completed run**
- In `src/jobs/processAgentRunJob.ts`, after the `POST_PROCESSING` task update, the processor now reads the task again through `followCancelledTask` before storing the report. If the task was cancelled, the run is cancelled too and the report is dropped.
- The check has to come before the report is stored: once a run has a stored report (`report_ready`), the run store won't let it become cancelled.
- I looked for the same defect elsewhere. Every other point where the processor waits on something and then changes the run already re-checks for a cancelled task first. The recovery paths for runs with a stored report only pick up runs that already have one, so this check covers them as well.
- A small gap remains between that read and storing the report. The tasks and the runs live in two separate stores, so a cancel landing in that moment can't be fully excluded. The unchecked wait on the update itself is gone.
- **Regression test:** the task is cancelled during the `POST_PROCESSING` update. The test checks that the run ends `cancelled` with no report, is never marked `report_ready` or `completed`, the task stays `cancelled`, and the workspace is cleaned up.

**F12 – runs that don't read repositories no longer need GitHub sign-in**
- I added `definitionReadsRepositories()` to `src/jobs/agentRuns/workspace.ts`: true only when the definition has `repository_read` and at least one repository.
- The workspace setup, the GitHub sign-in and the agent's repository access now all use that same check. GitHub credentials are fetched only when it's true; otherwise the workspace gets an empty token and no GitHub client, and the agent launches without repository access.
- **Regression tests:**
  - The GitHub-access step throws for three kinds of definition: no capability and no repositories, repositories but no `repository_read`, and `repository_read` with no repositories. In all three the run completes, GitHub access is never requested, and the agent gets no repository access.
  - A guard test checks that a run which does read repositories still fails cleanly when GitHub access fails.

**Unrelated change:** moving the GitHub-access decision into the processor took it over two eslint limits (function complexity and file length). To stay under them, I moved the agent launch options into a new `src/jobs/agentRuns/agentTaskOptions.ts`, along with the `AgentRunToolPolicy` type. `processAgentRunJob.ts` still exports that type, so existing imports keep working.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. I didn't need them for this.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 9930901 are holding the loop back:

  • Validate Changes — not finished
  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Connect Discovery and Darwin ACL (Node 22) — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, task tracking, and recovery without rerunning claimed agents. It needs changes before merge because additional repository checkouts bypass the repository context restriction enforced at launch.

✅ Guarded lifecycle transitions — Run claims and report publication use conditional transitions, preserving cancellation recorded on the run.

✅ Recovery coverage — Tests exercise stored-report recovery and task settlement failures without executing the agent again.

The supplied current-head status has no failures; four test shards remain pending. This review is based on static tracing; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F13: 🔴 Additional checkouts bypass context restrictions

  • Required behavior: Repository context restrictions enforced by the adapter must also constrain repository contents supplied through the new report workspace.

  • Evidence: src/jobs/agentRuns/workspace.ts, prepareRepositoryWorkspace and cloneContextRepository.

    1. Configure the primary repository acme/web with contextRepositories: 'none', and enable both acme/web and acme/api as monitored repositories.
    2. Trigger a definition with repository_read and repositories ['acme/web', 'acme/api']. Runtime validation accepts both because it checks repository enablement.
    3. prepareRepositoryWorkspace clones acme/api into the primary workspace’s .propr/context/ using the worker installation credential, without checking the primary repository’s context policy.
    4. At launch, prepareAgentGitAccess correctly restricts the token and external clone mounts to acme/web. However, acme/api is already inside the task workspace, so the executing agent can read its contents despite that restriction.

    The scoped token and clone-mount filtering cannot remove files already copied into the workspace. The supplied tests mock repository workspace preparation and therefore do not exercise this combination. static trace: verified against the new checkout loop, runtime validation, and the supplied adapter implementation.

  • Minimum fix: Before cloning additional repositories, resolve the primary repository’s effective context restriction using the existing policy semantics and reject any selected repository it excludes. Cover the restrictive-policy/multiple-repository case with a regression test.

Suggestions

These are optional follow-ups and are not sent to /fix.

S5: 🟢 Exercise actual adapter launches

The processor tests provide extensive lifecycle coverage, but substitute execution and repository workspace preparation. A follow-up integration test using the real adapter would help verify scratch Git directories, attachment visibility, and additional checkout handling across the launch boundary. This broader coverage is optional beyond the targeted regression needed for F1.

Score

The lifecycle implementation and recovery tests are substantial, but the repository context bypass prevents merge readiness. Current checks report no failures, with four shards still pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 26s
  • Tokens: 75,066 (72,903 in / 2,163 out)
  • Cost: $0.71

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F13 S5

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 63efe21

Addressed 1 AI review comment (IDs: 6022149861)

Addressed finding F13

Summary of Changes

I fixed F13: before a report run clones any additional repository, it now checks the primary repository's contextRepositories setting and rejects any repository the setting doesn't allow. In the reported case (acme/web set to 'none', run selecting ['acme/web', 'acme/api']), the run fails before anything is cloned, with a message naming acme/api and how to fix the setting. The processor, trigger and git-access tests pass (92 of 92), both typechecks are clean, and eslint reports no warnings on src/ or the two changed core files. I didn't run the rest of the test suite. No previews, since nothing visible changed.

What changed

  • One shared policy rule (packages/core/src/agents/agentGitAccess.ts): I moved the policy calculation out of prepareAgentGitAccess into a new exported function, resolveEffectiveContextRepositories. It reads every monitored entry for the repository and keeps only repositories that all of them allow, so conflicting entries never widen access. prepareAgentGitAccess now calls it, so the agent's token scope and the workspace checkout can't disagree. It is exported from @propr/core.
  • Check before cloning (src/jobs/agentRuns/workspace.ts): the new assertContextRepositoriesAllowed runs in prepareRepositoryWorkspace before the primary checkout and any extra clone. Names are compared ignoring case, and a setting of 'all' (or none at all) allows everything, as the adapter does. The workspace input takes an optional resolveContextPolicy so tests can supply a policy; by default it uses the repository settings.

I checked for other code that copies repositories into the workspace: cloneContextRepository is the only one, so this was the only occurrence of the defect.

Regression tests (3)

  • In test/processAgentRunJob.test.ts, a restrictive policy with two repositories is rejected before any clone. This test fails when the check is removed.
  • Also in that file, the check itself: 'all' and no setting allow everything, names match regardless of case, 'none' leaves only the primary repository, and every excluded repository is named.
  • In test/agentGitAccess.test.ts, conflicting entries narrow the policy, 'none' gives just the primary repository, and 'all' gives no restriction.

One thing to watch: the settings are read when the workspace is prepared and read again at agent launch. If someone tightens them in between, the checkout reflects the older setting while the token follows the newer one. Settings can't be read atomically across both steps, so I left that window as it is.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 0s
  • Tokens: 777,494 (769,953 in / 7,541 out)
  • Cost: $0.61

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…sitory, it now checks the primary repository's `contextRepositories` setting and rejects any repository the setting doesn't allow. In the reported case (`acme/web` set to `'none'`, run selecting `['acme/web', 'acme/api']`), the run fails before anything is cloned, with a message naming `acme/api` and how to fix the setting. The processor, trigger and git-access tests pass (92 of 92), both typechecks are clean, and eslint reports no warnings on `src/` or the two changed core files. I didn't run the rest of the test suite. No previews, since nothing visible changed.

I fixed F13: before a report run clones any additional repository, it now checks the primary repository's `contextRepositories` setting and rejects any repository the setting doesn't allow. In the reported case (`acme/web` set to `'none'`, run selecting `['acme/web', 'acme/api']`), the run fails before anything is cloned, with a message naming `acme/api` and how to fix the setting. The processor, trigger and git-access tests pass (92 of 92), both typechecks are clean, and eslint reports no warnings on `src/` or the two changed core files. I didn't run the rest of the test suite. No previews, since nothing visible changed.

**What changed**
- **One shared policy rule** (`packages/core/src/agents/agentGitAccess.ts`): I moved the policy calculation out of `prepareAgentGitAccess` into a new exported function, `resolveEffectiveContextRepositories`. It reads every monitored entry for the repository and keeps only repositories that all of them allow, so conflicting entries never widen access. `prepareAgentGitAccess` now calls it, so the agent's token scope and the workspace checkout can't disagree. It is exported from `@propr/core`.
- **Check before cloning** (`src/jobs/agentRuns/workspace.ts`): the new `assertContextRepositoriesAllowed` runs in `prepareRepositoryWorkspace` before the primary checkout and any extra clone. Names are compared ignoring case, and a setting of `'all'` (or none at all) allows everything, as the adapter does. The workspace input takes an optional `resolveContextPolicy` so tests can supply a policy; by default it uses the repository settings.

I checked for other code that copies repositories into the workspace: `cloneContextRepository` is the only one, so this was the only occurrence of the defect.

**Regression tests (3)**
- In `test/processAgentRunJob.test.ts`, a restrictive policy with two repositories is rejected before any clone. This test fails when the check is removed.
- Also in that file, the check itself: `'all'` and no setting allow everything, names match regardless of case, `'none'` leaves only the primary repository, and every excluded repository is named.
- In `test/agentGitAccess.test.ts`, conflicting entries narrow the policy, `'none'` gives just the primary repository, and `'all'` gives no restriction.

One thing to watch: the settings are read when the workspace is prepared and read again at agent launch. If someone tightens them in between, the checkout reflects the older setting while the token follows the newer one. Settings can't be read atomically across both steps, so I left that window as it is.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on 63efe21 are holding the loop back:

  • Validate Changes — not finished
  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Connect Discovery and Darwin ACL (Node 22) — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, task visibility, and retry-based lifecycle recovery. It needs changes before merge: context cloning exposes a worker credential temporarily, and validation failure on redelivery can leave an existing task unsettled.

✅ Guarded lifecycle transitions — Run claims and report publication use compare-and-set transitions, preventing late reports from overwriting cancelled runs.

✅ Recovery without repeat execution — Stored reports are finalized on redelivery without launching the agent again, with focused tests covering settlement failures.

✅ Workspace path protection — Reserved directories replace checked-out symlinks before host-side writes.

The supplied checks show no failures, with four test shards pending. This review uses static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F14: 🔴 Context cloning exposes the worker token

  • Required behavior: Worker installation credentials must not become accessible inside agent containers; adapters are supposed to provide scoped, read-only credentials.

  • Evidence: src/jobs/agentRuns/workspace.ts, cloneContextRepository; packages/core/src/agents/agentGitAccess.ts, buildAgentGitMountArgs.

    1. An existing agent runs with the default unrestricted context policy. Its container mounts /tmp/git-processor read-only, as shown in the supplied Git-access implementation.
    2. A new report run prepares an additional repository beneath its worktree under that directory. cloneContextRepository supplies the full worker installation token in the clone URL.
    3. Git writes that URL into the destination’s .git/config before fetching finishes. While the awaited clone fetch is running, the existing container can read that configuration through its live bind mount.
    4. The container obtains the worker credential rather than its deliberately restricted agent credential.

    The subsequent remote set-url removes the credential only after cloning finishes. Read-only mounts permit reading secrets, and the existing scrubber visits managed clone roots, not these nested context repositories under worktrees. static trace: the new authenticated clone destination intersects the explicitly supplied blanket mount; no exploitation test was executed.

  • Minimum fix: Authenticate context clones through a transient credential mechanism that does not persist the worker token in the destination or another agent-visible file. Keep the remote URL credential-free throughout preparation.

F15: 🔴 Validation retries can strand existing tasks

  • Required behavior: When a report delivery settles its run as failed, any task already created for that delivery must also be settled or retain a retryable reconciliation obligation.

  • Evidence: src/jobs/processAgentRunJob.ts, processAgentRun validation branch and task-creation/claim sequence.

    1. A queued run passes validation and createTaskStateIfAbsent creates its pending task.
    2. The awaited transitionRun(..., ['queued'], 'running', ...) fails before committing, for example during a database outage. It is outside the execution try, so BullMQ retries while the run remains queued and the task exists.
    3. Before redelivery, an administrator disables a repository or agent used by the definition. The runtime validation explicitly checks this live configuration.
    4. Redelivery takes the invalid-definition branch, successfully marks the queued run failed, and returns normally without reconciling its existing task.
    5. The job finishes with a failed run and a pending task. This processor schedules no further delivery to repair that mismatch.

    The guarded claim prevents duplicate execution but does not remove the task created before it. reconcileEndedRun handles this obligation only when another delivery begins with an already-ended run; this delivery instead ends normally immediately after validation fails. static trace: the supplied runtime validator, retry options, task creation contract, and processor ordering establish this sequence. The validation test covers only a run without an existing task.

  • Minimum fix: After validation failure settles the run, reconcile any existing report task using the same ended-run handling. Propagate settlement failures so retries remain available; do not create a task solely for validation failure.

Suggestions

These are optional follow-ups and are not sent to /fix.

S6: 🟢 Verify interrupted-result handling

reportFromResult checks success and report content but does not inspect terminationReason. The supplied result contract supports timeout, turn-limit, spend-cap, and watchdog termination metadata. Add adapter-level coverage establishing whether these outcomes can return successful partial text and how reports should classify it. This is a follow-up because the supplied excerpts do not establish the actual producer behavior needed to demonstrate a blocker.

Score

The lifecycle coverage is substantial, and current checks report no failures. The credential exposure and retry-settlement defect require correction before merge.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 32s
  • Tokens: 74,972 (72,705 in / 2,267 out)
  • Cost: $0.71

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F14 F15 S6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 69f6637

Addressed 1 AI review comment (IDs: 6022380736)

Addressed findings F14, F15

Summary of Changes

I fixed F14 and F15. The tests for the processor, trigger and worker credentials pass (74 of 74). The root and packages/core typechecks are clean, and npx eslint src/ --max-warnings 0 reports nothing. I added 3 regression tests, and all 3 fail when run against the previous source. I didn't run the rest of the test suite. There are no previews, since nothing visible changed.

F14: context clones exposed the worker token. cloneContextRepository in src/jobs/agentRuns/workspace.ts now clones from the plain https://github.com/<owner>/<repo>.git URL. The token is passed only in the git command's own environment, as an auth header. This is the same helper (configureGitAuthentication) that the shared repository clones already use. So the token never appears in the clone URL or in .git/config, not even while the clone is running, and the follow-up remote set-url step is gone. I exported that helper from @propr/core (packages/core/src/index.ts).

  • Regression test: it puts a fake git on the path that records each command and writes the clone URL into .git/config the way real git does. The test checks that the token is never passed on the command line or written to the config, and that it reaches git only through the header.
  • Same pattern elsewhere: the only other repository fetch in the report-run path is the primary checkout through ensureRepoCloned, and it already authenticates this way.

F15: validation retries could leave a task stuck. When a definition fails validation, the run is still marked failed first. After that, a new helper settleExistingTask in src/jobs/processAgentRunJob.ts ends any report task an earlier attempt already created, using the existing ended-run handling. If there is no task, none is created. If the task can't be read or updated, the error is passed up so the job is retried, and the retry finishes ending it. reconcileEndedRun now uses the same helper.

  • Regression tests:
    • The exact reported sequence: the claim fails during a database outage, the definition becomes invalid, and the retry fails both the run and its existing task without executing anything.
    • Ending the task fails once: the delivery is rejected, and the retry finishes the job.
  • Unchanged: the existing test where an invalid definition has no task still passes with no task calls.

I found no other problems while checking these paths.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. They weren't needed for this fix.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 20s
  • Tokens: 1,238,923 (1,228,806 in / 10,117 out)
  • Cost: $0.75

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…nd worker credentials pass (74 of 74). The root and `packages/core` typechecks are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 3 regression tests, and all 3 fail when run against the previous source. I didn't run the rest of the test suite. There are no previews, since nothing visible changed.

I fixed F14 and F15. The tests for the processor, trigger and worker credentials pass (74 of 74). The root and `packages/core` typechecks are clean, and `npx eslint src/ --max-warnings 0` reports nothing. I added 3 regression tests, and all 3 fail when run against the previous source. I didn't run the rest of the test suite. There are no previews, since nothing visible changed.

**F14: context clones exposed the worker token.** `cloneContextRepository` in `src/jobs/agentRuns/workspace.ts` now clones from the plain `https://github.com/<owner>/<repo>.git` URL. The token is passed only in the git command's own environment, as an auth header. This is the same helper (`configureGitAuthentication`) that the shared repository clones already use. So the token never appears in the clone URL or in `.git/config`, not even while the clone is running, and the follow-up `remote set-url` step is gone. I exported that helper from `@propr/core` (`packages/core/src/index.ts`).
- **Regression test:** it puts a fake `git` on the path that records each command and writes the clone URL into `.git/config` the way real git does. The test checks that the token is never passed on the command line or written to the config, and that it reaches git only through the header.
- **Same pattern elsewhere:** the only other repository fetch in the report-run path is the primary checkout through `ensureRepoCloned`, and it already authenticates this way.

**F15: validation retries could leave a task stuck.** When a definition fails validation, the run is still marked failed first. After that, a new helper `settleExistingTask` in `src/jobs/processAgentRunJob.ts` ends any report task an earlier attempt already created, using the existing ended-run handling. If there is no task, none is created. If the task can't be read or updated, the error is passed up so the job is retried, and the retry finishes ending it. `reconcileEndedRun` now uses the same helper.
- **Regression tests:**
  - The exact reported sequence: the claim fails during a database outage, the definition becomes invalid, and the retry fails both the run and its existing task without executing anything.
  - Ending the task fails once: the delivery is rejected, and the retry finishes the job.
- **Unchanged:** the existing test where an invalid definition has no task still passes with no task calls.

I found no other problems while checking these paths.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. They weren't needed for this fix.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, task tracking, and recovery after interrupted deliveries. It needs a localized correctness fix before merge.

✅ Recovery without re-execution — Stored reports are finalized on redelivery without launching the agent again.

✅ Repository access isolation — Repository-free launches explicitly remove credentials and clone mounts.

✅ Lifecycle coverage — Tests cover cancellation, competing claims, persistence failures, and task settlement.

This review used static analysis only. The supplied status shows no failed checks and four pending test shards.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F16: 🔴 Reject incomplete execution results

  • Required behavior: A completed report run must represent finished execution; provider termination must not be silently converted into successful completion.

  • Evidence: src/jobs/agentRuns/runErrors.ts, reportFromResult; src/jobs/processAgentRunJob.ts, report storage and finalization.

    1. An execution returns a nonempty summary with success: true and an explicit terminationReason, such as max_turns or timeout. The supplied AgentExecutionResult contract separately represents these otherwise publishable executions that stopped before completion.
    2. reportFromResult checks only success and whether extracted text is nonempty. It accepts the interrupted execution’s text without examining terminationReason.
    3. The processor stores that text as report_ready and advances a dry run to completed. Preview and auto runs likewise receive a report eligible for subsequent processing.

    Users therefore receive an incomplete execution as a successfully finished report, and subsequent runs can consume it as a previous report. Cancellation checks do not detect provider termination, and the added tests cover unsuccessful and empty results but omit successful results carrying termination metadata.

    static trace: traced the supplied result contract through reportFromResult, report persistence, autonomy advancement, and previous-report eligibility. proposed regression: return a nonempty successful result carrying terminationReason: 'max_turns' and assert that the run does not complete successfully.

  • Minimum fix: Check the existing incomplete-execution classification before accepting the report, and route interrupted executions through failure settlement with an explanatory reason. Add regression coverage for successful results carrying termination metadata.

Suggestions

These are optional follow-ups and are not sent to /fix.

S7: 🟢 Exercise a real adapter boundary

The processor tests predominantly inject execution and workspace dependencies. A focused integration test using the actual adapter preparation path would strengthen confidence that scratch workspaces, task cancellation, and repository restrictions survive the complete launch path. This is additional coverage, not a separate demonstrated blocker.

Score

The implementation has substantial lifecycle coverage and careful recovery handling, but incomplete executions can currently become successful reports. The pending checks have not established any additional failure.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 46s
  • Tokens: 74,163 (73,090 in / 1,073 out)
  • Cost: $0.67

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix F16 S7

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit db4f791

Addressed 1 AI review comment (IDs: 6022542576)

Addressed finding F16

Summary of Changes

I fixed F16. A report run whose result says the provider stopped it early (for example on the turn limit or a timeout) now fails, even if it reported success and returned text. Before, that text was stored as a finished report.

Fix: reportFromResult in src/jobs/agentRuns/runErrors.ts now checks why the run stopped before it accepts the report. It does this with the existing resolveAgentTerminationReason, so it covers both a terminationReason set on the result and termination signs in the result's other fields. If a reason is found, it throws an AgentRunReportError with the message Agent execution stopped before completion: <description>. That error goes through the processor's existing failure handling: the run and its task are marked failed, the reason is saved, and the workspace is cleaned up. Because no report is saved, a later run can't pick up the partial text as a previous report.

I didn't use the existing isIncompleteAgentExecution helper because it only applies when success === false, which is exactly the case this bug slipped through. reportFromResult is called in only one place (the report step in processAgentRunJob.ts), so there were no other copies of the same mistake in this PR's changes.

Tests: I added 2 regression tests to test/processAgentRunJob.test.ts. Each returns a successful, non-empty result with terminationReason set to max_turns or timeout, then checks that:

  • the run ends as failed.
  • no report is saved.
  • the failure reason explains why.
  • the task is failed and the workspace is cleaned up.

Verification:

  • The processor and trigger tests pass (75 of 75).
  • Both new tests fail when run against the previous runErrors.ts.
  • tsc --noEmit is clean and npx eslint src/ --max-warnings 0 reports nothing.
  • I didn't run the rest of the test suite.
  • The test files only run with PROPR_DEMO_MODE=true and --experimental-test-module-mocks. Without the first, startup exits because GitHub auth isn't configured. I also rebuilt packages/shared and packages/core before running them.

No previews, since nothing visible changed.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. They weren't needed for this fix.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 4m 7s
  • Tokens: 1,061,410 (1,055,186 in / 6,224 out)
  • Cost: $0.52

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…opped it early (for example on the turn limit or a timeout) now fails, even if it reported success and returned text. Before, that text was stored as a finished report.

I fixed F16. A report run whose result says the provider stopped it early (for example on the turn limit or a timeout) now fails, even if it reported success and returned text. Before, that text was stored as a finished report.

**Fix:** `reportFromResult` in `src/jobs/agentRuns/runErrors.ts` now checks why the run stopped before it accepts the report. It does this with the existing `resolveAgentTerminationReason`, so it covers both a `terminationReason` set on the result and termination signs in the result's other fields. If a reason is found, it throws an `AgentRunReportError` with the message `Agent execution stopped before completion: <description>`. That error goes through the processor's existing failure handling: the run and its task are marked failed, the reason is saved, and the workspace is cleaned up. Because no report is saved, a later run can't pick up the partial text as a previous report.

I didn't use the existing `isIncompleteAgentExecution` helper because it only applies when `success === false`, which is exactly the case this bug slipped through. `reportFromResult` is called in only one place (the report step in `processAgentRunJob.ts`), so there were no other copies of the same mistake in this PR's changes.

**Tests:** I added 2 regression tests to `test/processAgentRunJob.test.ts`. Each returns a successful, non-empty result with `terminationReason` set to `max_turns` or `timeout`, then checks that:
- the run ends as `failed`.
- no report is saved.
- the failure reason explains why.
- the task is failed and the workspace is cleaned up.

**Verification:**
- The processor and trigger tests pass (75 of 75).
- Both new tests fail when run against the previous `runErrors.ts`.
- `tsc --noEmit` is clean and `npx eslint src/ --max-warnings 0` reports nothing.
- I didn't run the rest of the test suite.
- The test files only run with `PROPR_DEMO_MODE=true` and `--experimental-test-module-mocks`. Without the first, startup exits because GitHub auth isn't configured. I also rebuilt `packages/shared` and `packages/core` before running them.

No previews, since nothing visible changed.

The Gmail, Google Calendar and Google Drive connectors need authorizing in your claude.ai connector settings before they can be used. They weren't needed for this fix.

PR: #2839
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

⏳ Ultrafix is waiting for CI before the next /review.

These blocking checks on db4f791 are holding the loop back:

  • Connect Discovery and Darwin ACL (Node 22) — not finished
  • Windows Connect Discovery (ordinary user, Node 22) — not finished
  • Validate Changes — not finished

Checks matching this repository's non-blocking checks never gate Ultrafix. The loop continues automatically once the blocking checks pass; if they have not settled within 2 hours, Ultrafix stops.

@propr-dev

propr-dev Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements report execution, workspace preparation, task tracking, and recovery without rerunning a claimed agent. The supplied code supports merge readiness, conditional on the four pending test shards completing successfully.

✅ Recovery preserves stored reports — Redelivery finalizes report_ready and completed runs without executing the agent again.

✅ Repository access is explicitly gated — Repository-free runs skip GitHub authentication, and the adapter returns empty credentials and clone mounts.

✅ Cancellation coverage is substantial — Tests exercise cancellation during preparation, execution, post-processing, and task settlement failures.

This was a static review of the supplied diff and context; no commands or tests were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S8: 🟢 Test actual adapter integration

The processor tests mock executeTask, while workspace tests exercise scratch preparation separately. An integration test passing a real scratch workspace through an adapter would strengthen confidence that empty Git repositories, missing GitHub credentials, and report extraction work together. This is additional verification, not a demonstrated defect.

S9: 🟢 Verify interrupted workspace cleanup

Normal execution and preparation failures clean up their workspaces, but recoverAbandonedRun only reconciles run and task state. Verify that existing periodic cleanup covers both repository worktrees and _agent-runs scratch directories after process termination. The supplied context does not establish whether that cleanup already exists, so this remains an optional follow-up.

Score

The implementation has substantial lifecycle coverage and no verified merge blocker in the supplied code. Current checks report no failures, with four test shards still pending.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 54s
  • Tokens: 75,346 (74,150 in / 1,196 out)
  • Cost: $0.69

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S8 S9

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Oct 6, 2026
@propr-dev
propr-dev Bot merged commit 0e7b9e2 into 2800-epic-agents-v1-y7t Oct 6, 2026
42 checks passed
@propr-dev
propr-dev Bot deleted the 2806/claude-opus-5-5-agents-v1-7-17-report-run-20261006-1606-5i8 branch October 6, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants