Skip to content

[3620 by Claude Opus 5.5] Nightly test fails on hosts without /usr/local/bin/node; an older image on a newer database dies with "migration directory is corrupt" - #3652

Merged
integry merged 1 commit into
3616-epic-0-9-d8bfrom
3620/claude-opus-5-5-nightly-test-fails-on-hos-20261117-0305-q6v
Nov 17, 2026
Merged

integry merged 1 commit into
3616-epic-0-9-d8bfrom
3620/claude-opus-5-5-nightly-test-fails-on-hos-20261117-0305-q6v

Conversation

@integry

@integry integry commented Nov 17, 2026 •

Copy link
Copy Markdown
Owner

Resolves #3620

The ProPR run for this issue finished and pushed its commit (c1e1862) at 03:19 UTC, but no pull request was opened. This PR was opened by hand from that branch so the work can be reviewed and merged into the epic.

🤖 Generated with Claude Code

1. Nightly bridge test fails on hosts without `/usr/local/bin/node`
- In `packages/core/test/extensionPackageServers.test.ts`, `bridgeSession()` now swaps the bridge's `executable` from `/usr/local/bin/node` to `process.execPath`, alongside the `args[0]` rewrite it already did.
- The suite passes (7/7), but only on this container, which does have `/usr/local/bin/node`. I didn't run it on a host without it, so the case the nightly hits isn't directly reproduced.
- The other tests that spawn the bridge don't make the same assumption. `extensionStdioBridge`, `extensionProfiles` and `agentToolPolicyRuntime` already use `/usr/bin/env`, `process.execPath`, or replace the path.

2. Older image on a newer database
- `packages/core/src/db/migrationGate.ts` has a new check that runs before `migrate.latest()`. It lists the names in `knex_migrations` that this build's migration folder doesn't contain. A blank database with no migrations table passes.
- If there are any, `runMigrations()` in `connection.ts` prints the exact message from the issue (`This database was migrated by a newer ProPR version (N newer migrations, latest: <name>). …`) to stderr, with no stack trace, and exits with code 1. stderr is where the launcher's migration phase reads its one-line failure reason from.
- Tests:
  - Unit tests in `test/databaseMigrationGate.test.ts` cover the blank, current, behind and newer cases.
  - A test in `test/sqliteSerializedStartup.test.ts` runs the real migrate command on a database with two extra migration rows. It checks for exit code 1, the exact message, no "corrupt" text and no stack lines.
  - With the check commented out, that test fails on knex's "migration directory is corrupt" error.

3. Demo-mode 403s in the browser console
- I fixed this in the UI, not by opening the routes in the API allow-list, because these endpoints probe Agent Tank, registries and stored credentials. It covers the eight endpoints in the issue plus `/api/instance/extensions/v1/history`.
- A new file, `propr-ui/src/api/demoModeRequestGate.ts`, holds the list of read endpoints the demo user may not make. When demo mode is on, `apiFetch` answers those GET requests itself with the same 403 body the API sends, without a network request. Pages behave as before, and nothing shows in the console.
- `DemoModeProvider` turns the gate on before the pages mount. If you close another route to the demo user later, it needs adding to this list as well.
- To keep `apiClient.ts` under the 400-line lint limit, I folded one retry branch in `apiFetch` into a single line; it does the same thing.
- Test: the new Playwright test `e2e/demo-mode-admin-reads.pw.ts` uses a mocked API in demo mode and opens Dashboard, Analytics, Coding agents, LLM Log, Settings and New automation. It checks that none of these endpoints is requested and that no 4xx errors appear in the console. It passes 6/6. With the gate turned off, all six fail and list exactly the endpoints from the issue.

Typecheck and lint are clean for `packages/core` and `propr-ui`, and the `propr-ui` API and context unit tests pass (164). I didn't create preview images, since the only visible difference is the missing console errors.
@propr-dev propr-dev Bot changed the title [3620 by Claude Opus 5.5] Nightly test fails on hosts without /usr/local/bin/node; an older image on a newer database dies with "migration directory is corrupt" 🔨 [3620 by Claude Opus 5.5] Nightly test fails on hosts without /usr/local/bin/node; an older image on a newer database dies with "migration directory is corrupt" Nov 17, 2026

integry commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

/ultrafix goal=8 max=6

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

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

First action: /review

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

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

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

Overall Evaluation

The PR adds a clearer startup refusal for databases containing migrations absent from the running build, suppresses selected demo-only network refusals, and makes the extension bridge test use the test runner’s Node executable. No merge-blocking defect is demonstrated by the supplied code. It is ready to merge within the reviewed scope, conditional on the five pending checks completing successfully.

✅ Clear migration refusal — The compatibility check runs before migration execution, and the added subprocess test checks exit status, migration details, and absence of the misleading corruption message or stack trace.

✅ Preserved demo response contract — The local gate reproduces the server’s 403 response body, applies only to selected GET requests, and preserves the demo-specific error consumed by the extension API.

✅ Portable bridge test — The test substitutes process.execPath while retaining its assertion that production configuration specifies /usr/local/bin/node.

Review conclusions are based on static inspection of the supplied diff and surrounding context; no commands or tests were run.

Merge blockers

No merge blockers.

Suggestions

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

S1: 🟢 Assert destination pages actually render

In propr-ui/e2e/demo-mode-admin-reads.pw.ts, the generic demo-text assertion and blanket 503 responses do not establish that each destination mounted the components responsible for the prohibited reads. Adding a page-specific readiness assertion and successful fixtures for necessary page data would strengthen these tests against false positives. This is an optional coverage improvement; the supplied code does not demonstrate that a tested page currently fails to mount.

S2: 🟢 Cover request-gate boundary inputs

Focused tests for demoModeUnavailableResponse would usefully cover inactive mode, switching back to inactive mode, POST passthrough, Request inputs, query strings, and prefixed API URLs. The new browser tests exercise demo navigation, but do not directly constrain these branches. No defect in those branches is established here, so this is optional regression coverage.

Score

The implementation is focused and has relevant migration and browser coverage, with no verified blocker. The authoritative status reports zero failed checks and five pending checks; final merge readiness remains conditional on their completion.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 36s
  • Tokens: 47,966 (47,435 in / 531 out)
  • Cost: $0.37

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 S1 S2

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 17, 2026
@integry
integry merged commit 3ed391f into 3616-epic-0-9-d8b Nov 17, 2026
47 checks passed
@propr-dev propr-dev Bot changed the title 🔨 [3620 by Claude Opus 5.5] Nightly test fails on hosts without /usr/local/bin/node; an older image on a newer database dies with "migration directory is corrupt" [3620 by Claude Opus 5.5] Nightly test fails on hosts without /usr/local/bin/node; an older image on a newer database dies with "migration directory is corrupt" Nov 17, 2026
propr-dev Bot pushed a commit that referenced this pull request Nov 18, 2026
…failed task, with an issue comment naming the step that failed. Runs with no changes still end with a "No code changes needed" comment.

Why #3620 was reported done without a PR. The run's records show the commit was made and pushed, but nothing reached GitHub afterwards:

- The commit and push worked. Commit `c1e1862e` was made at 03:18:50 and pushed at 03:18:52.
- PR creation was reached. The "Review digest" event at 03:18:55 is recorded inside the PR creation step.
- Then nothing was posted. No PR, no failure comment, no label change (`AI-processing` stayed on, `AI-done` was never added). PR #3652 was opened by hand at 07:06.
- The task was still marked a success. It was recorded at 03:19:00 as "Task completed successfully", with status `claude_success_no_changes`, `pr: null`, and a commit attached.

So this was a swallowed PR creation error, not "no commits" and not a push failure. Three gaps in `src/jobs` let it reach the success path (the pipeline lives there, not in `packages/core/src`):

1. When opening the PR failed, the error was caught and the fallback comment was posted. If that comment also failed, nothing showed on the issue at all.
2. The final-validation step can open the missing PR, but its result was thrown away.
3. The step that sets the task's final status only checked "agent succeeded" and "a PR exists". "Agent succeeded, no PR" became `claude_success_no_changes`, even with a commit.

The worker log with the exact GitHub error isn't kept; the task logs only hold the agent conversation. The fact that both the PR request and the comment failed points to GitHub rejecting all API calls at that moment, possibly the installation rate limit in #3680 item 10. That part is unconfirmed.

What changed:
- Failed state. A successful agent run with a commit, or with a failed step, but no PR is now marked failed with status `publication_failed`. The reason names the step, e.g. "Opening the pull request failed: …". Runs with no changes still complete as "no changes". The fix is in `src/jobs/issueJob/completion.ts`, the same check as `getTaskCompletionStatus`.
- Comment names the step. Post-processing now tracks the current step (commit, push, opening the PR). The comment reads, for example: "❌ Opening the pull request failed. The changes were committed (`c1e1862`) and pushed to `<branch>`, so no pull request was opened." The issue no longer gets `AI-done` in this case; it keeps its `AI` label and loses `AI-processing`.
- No silent success. A PR creation call that returns no PR is now treated as a failure.
- Comment is harder to suppress. A failed label change or report can no longer stop the failure comment from being posted. If GitHub rejects every call, as it seems to have for #3620, the comment can still be lost; the failed task state is what stays reliable then.
- Recovered PRs count. A PR opened by the final-validation retry now becomes the run's outcome.
- Cancellation unchanged. A user cancel is not reported as a failed step.

I moved the failure handler into `src/jobs/issueJobPostProcessingFailure.ts` to stay under the 400-line lint limit. The step names live in `src/jobs/postProcessingStep.ts`.

Tests: typecheck and lint pass on `src/jobs/`.
- New tests. `test/issueJobPublicationFailure.test.ts` (8 tests) covers both outcomes: commit then PR failure, a PR call returning nothing, commit failure, no changes, and recovered or still-missing PR. `test/issueJobCompletion.test.ts` has 5 new tests on the final task status.
- Negative check. Against the old `completion.ts`, 3 of the new status tests fail.
- Changed test. In `test/prCompletionTriggerReleaseFailure.test.ts` I updated one test that asserted the old "Post-processing encountered an error" comment and the `AI-done` label.
- Existing suites. The other 22 root suites and 1 API suite that use these modules all pass.

Not covered: if the agent commits on its own and leaves nothing staged, the run still takes the "no changes" path. That didn't happen in #3620 (ProPR made that commit), so I left it out of this fix.

No preview images, since nothing here is visual.
integry pushed a commit that referenced this pull request Nov 18, 2026
…pull request (#3710)

Why #3620 was reported done without a PR. The run's records show the commit was made and pushed, but nothing reached GitHub afterwards:

- The commit and push worked. Commit `c1e1862e` was made at 03:18:50 and pushed at 03:18:52.
- PR creation was reached. The "Review digest" event at 03:18:55 is recorded inside the PR creation step.
- Then nothing was posted. No PR, no failure comment, no label change (`AI-processing` stayed on, `AI-done` was never added). PR #3652 was opened by hand at 07:06.
- The task was still marked a success. It was recorded at 03:19:00 as "Task completed successfully", with status `claude_success_no_changes`, `pr: null`, and a commit attached.

So this was a swallowed PR creation error, not "no commits" and not a push failure. Three gaps in `src/jobs` let it reach the success path (the pipeline lives there, not in `packages/core/src`):

1. When opening the PR failed, the error was caught and the fallback comment was posted. If that comment also failed, nothing showed on the issue at all.
2. The final-validation step can open the missing PR, but its result was thrown away.
3. The step that sets the task's final status only checked "agent succeeded" and "a PR exists". "Agent succeeded, no PR" became `claude_success_no_changes`, even with a commit.

The worker log with the exact GitHub error isn't kept; the task logs only hold the agent conversation. The fact that both the PR request and the comment failed points to GitHub rejecting all API calls at that moment, possibly the installation rate limit in #3680 item 10. That part is unconfirmed.

What changed:
- Failed state. A successful agent run with a commit, or with a failed step, but no PR is now marked failed with status `publication_failed`. The reason names the step, e.g. "Opening the pull request failed: …". Runs with no changes still complete as "no changes". The fix is in `src/jobs/issueJob/completion.ts`, the same check as `getTaskCompletionStatus`.
- Comment names the step. Post-processing now tracks the current step (commit, push, opening the PR). The comment reads, for example: "❌ Opening the pull request failed. The changes were committed (`c1e1862`) and pushed to `<branch>`, so no pull request was opened." The issue no longer gets `AI-done` in this case; it keeps its `AI` label and loses `AI-processing`.
- No silent success. A PR creation call that returns no PR is now treated as a failure.
- Comment is harder to suppress. A failed label change or report can no longer stop the failure comment from being posted. If GitHub rejects every call, as it seems to have for #3620, the comment can still be lost; the failed task state is what stays reliable then.
- Recovered PRs count. A PR opened by the final-validation retry now becomes the run's outcome.
- Cancellation unchanged. A user cancel is not reported as a failed step.

I moved the failure handler into `src/jobs/issueJobPostProcessingFailure.ts` to stay under the 400-line lint limit. The step names live in `src/jobs/postProcessingStep.ts`.

Tests: typecheck and lint pass on `src/jobs/`.
- New tests. `test/issueJobPublicationFailure.test.ts` (8 tests) covers both outcomes: commit then PR failure, a PR call returning nothing, commit failure, no changes, and recovered or still-missing PR. `test/issueJobCompletion.test.ts` has 5 new tests on the final task status.
- Negative check. Against the old `completion.ts`, 3 of the new status tests fail.
- Changed test. In `test/prCompletionTriggerReleaseFailure.test.ts` I updated one test that asserted the old "Post-processing encountered an error" comment and the `AI-done` label.
- Existing suites. The other 22 root suites and 1 API suite that use these modules all pass.

Not covered: if the agent commits on its own and leaves nothing staged, the run still takes the "no changes" path. That didn't happen in #3620 (ProPR made that commit), so I left it out of this fix.

No preview images, since nothing here is visual.

Co-authored-by: propr-dev[bot] <1316198+propr-dev[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant