Skip to content

Fix command runner timeout issue#4082

Draft
richardhjtan wants to merge 1 commit intocs-9945-submission-bot-open-a-github-prfrom
fix-timeout-issue
Draft

Fix command runner timeout issue#4082
richardhjtan wants to merge 1 commit intocs-9945-submission-bot-open-a-github-prfrom
fix-timeout-issue

Conversation

@richardhjtan
Copy link
Contributor

Root cause fixed: create-submission was saving a large SubmissionCard (with all file contents) synchronously inside the 30-second Puppeteer timeout window. The "temporary" doNotWaitForPersist fix was a race condition — the page could be released before the background save finished.


Files changed:

  1. create-submission.ts — Changed to doNotPersist: true. The command is now a pure computation: it collects files, returns the data in-memory for the bot-runner (no HTTP save, no timeout risk).
  2. save-submission.ts (new) — A new command that re-fetches the listing files and reliably persists the SubmissionCard to the realm. It's designed to run with a 300-second timeout, well clear of the payload size.
  3. command.gts — Added SaveSubmissionInput class (same fields as CreateSubmissionInput).
  4. tasks/run-command.ts — Added puppeteerTimeoutMs: number | null to RunCommandArgs. The task now passes this through to prerenderer.runCommand().
  5. jobs/run-command.ts — enqueueRunCommandJob now accepts an optional jobTimeoutSec parameter to override the default 60-second queue timeout.
  6. index.ts — Added opts to the RunCommandArgs prerenderer interface type.
  7. bot-runner/command-runner.ts — After openCreateListingPR() succeeds, a fire-and-forget save-submission job is enqueued (300s job timeout, 280s Puppeteer timeout). Errors are logged but don't fail the PR flow.
  8. bot-runner tests — Updated command-runner-test.ts and bot-runner-test.ts to include puppeteerTimeoutMs: null in expected payloads and assert that the save-submission job is enqueued after PR creation.

@richardhjtan richardhjtan marked this pull request as draft February 27, 2026 09:19
@richardhjtan richardhjtan changed the title Fix command timeout issue Fix command runner timeout issue Feb 27, 2026
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 92ca85b4c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +85 to +87
opts: args.puppeteerTimeoutMs
? { timeoutMs: args.puppeteerTimeoutMs }
: undefined,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Forward the Puppeteer timeout to the prerender service

Setting opts.timeoutMs here does not currently change runtime behavior because the downstream proxy path drops it: packages/realm-server/prerender/remote-prerenderer.ts runCommand() only forwards { realm, auth, command, commandInput }, and packages/realm-server/prerender/prerender-app.ts /run-command also calls prerenderer.runCommand(...) without opts. In the save-submission flow this means the command still runs with the default 30s render timeout, so large submissions can continue to fail even though puppeteerTimeoutMs is set to 280000.

Useful? React with 👍 / 👎.

@github-actions
Copy link

Preview deployments

@github-actions
Copy link

Host Test Results

    1 files  ±0      1 suites  ±0   1h 30m 53s ⏱️ - 5m 36s
1 872 tests +1  1 854 ✅  - 1  15 💤 ±0  0 ❌ ±0  3 🔥 +2 
1 887 runs  +1  1 866 ✅  - 3  15 💤 ±0  3 ❌ +2  3 🔥 +2 

For more details on these errors, see this check.

Results for commit 92ca85b. ± Comparison against base commit 36bd710.

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