Skip to content

feat(core): let Code Mode scripts block for 2 minutes before moving to the background - #64957

Merged
jlongster merged 1 commit into
devfrom
codemode-block-2m
Nov 19, 2026
Merged

jlongster merged 1 commit into
devfrom
codemode-block-2m

Conversation

@jlongster

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

A Code Mode script now blocks the turn for up to 2 minutes (was 10 seconds) before moving to the background. Only affects full_codemode, since scripts only run as jobs with it on. The window is now a named BLOCK_TIMEOUT constant; the e2e tests advance the TestClock to match.

How did you verify your code works?

bun run typecheck:tsc and oxlint pass. bun test test/subagent-idle-e2e.test.ts: 10 pass, 1 fail ("a slow script stays in the foreground with the flag off"). That test fails the same way on dev without this change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…o the background

User decisions:
- Move a Code Mode script to the background after 2 minutes instead of 10 seconds

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good. A Code Mode script now stays in the foreground until the 2-minute mark and moves to the background right at it. I checked this by temporarily changing the e2e test to stop at 119s (script still running) and then 120s (receipt returned and the result delivered later). All 11 tests in subagent-idle-e2e.test.ts pass locally, including the flag-off test the description says fails, and typecheck:tsc is clean. Interrupting the turn during the longer wait still cancels the job as before.

Public API is unchanged.

@jlongster
jlongster merged commit a41a535 into dev Nov 19, 2026
11 checks passed
@jlongster
jlongster deleted the codemode-block-2m branch November 19, 2026 19:05
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.

1 participant