Skip to content

🤖 tests: cover createUnderTaskTreeLifecycleLock paths before the split - #7701

Merged
ThomasK33 merged 5 commits into
mainfrom
refactor/task-create-tests
Oct 28, 2026
Merged

ThomasK33 merged 5 commits into
mainfrom
refactor/task-create-tests

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds 27 characterization tests for TaskService.createUnderTaskTreeLifecycleLock, with no production change. Line coverage of the method goes from 94 % (673 of 716 lines) to 100 %, except one check that a generated task name is valid, which no input can reach. This is the test PR at the start of stack 5 of the TaskService hotspot split. The split PRs on top of it split the method (CC 122) into named steps.

What the tests cover

The new file is taskService.createUnderLock.test.ts. It uses the existing harness.

  • Input validation: a bad kind, prompt or agent id, and five bad bestOf values.
  • Parent gates: an unknown parent, an untrusted project, and a parent that already reported.
  • Agents: a disabled agent, an unknown agent whose discovery throws, and the skip_init_hook flag. An agent with the flag skips the init hook on launch, and one without it runs the hook.
  • AI settings: an invalid explicit model. A non-transport error propagates, and the next create still runs, which shows that the global mutex was released.
  • Queued branch: no parent branch, a project row that another writer removed, and a failed persist.
  • Launch failure:
    • The marker write rejects: the row stays running, and the attempt stays closing.
    • A fork fails.
    • The persist cannot find the parent row.
    • The project row was removed.
  • Send: the row stops being an agent task before the launch send. Nothing sends, the row becomes interrupted, and the attempt is settled.
  • Superseded launch: a superseded launch failure with an admitted send that is not the live turn.

Three tests simulate another writer in the middle of the create. Two wrap config.editConfig once, and one makes editWorkspaceEntry reject. No plain input reaches those lines.

Validation

  • All 27 tests pass on the current code.
  • Two later commits came from review and from the split PRs. A Codex finding asked one test to wait for the queue drain that its create schedules. The skip_init_hook tests close a gap that mutation testing found: no test failed when the check was inverted. Both new tests now fail under that mutant.
  • A scratch script made one edit to each covered branch. Each test failed under its own edit, and I restored the file after each run.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high • Cost: $164.39

Characterization tests for the create paths no other suite reaches: argument and bestOf validation, the parent gates, the agent hint, AI-settings errors, the queued branch, fork and persist failures, and the launch-failure CAS, admission and superseded-liveness branches. No production change.
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T15:05:27.308074Z 859fa5c Manual request
🔒 Security Review ✅ Completed 2026-10-28T15:06:12.818280Z 859fa5c Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 54c75a0ee5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

Copy link
Copy Markdown

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: 54c75a0ee5

ℹ️ 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 thread src/node/services/taskService.createUnderLock.test.ts
@github-actions

github-actions Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e stories (Haiku): 14 passed

22 agent steps · 7 replayed from cache · 15 model calls · 46.3k tokens (28% cached)
Spend: $0.08 of the $1.00 cap (proxy ledger)

All 14 tests in 9 files
Test Agent Time
🟢 chatRestart.e2e.ts · 1 passed 1 step · 1 call 5.7s
🟢 a chat survives a restart of the server 1 step · 1 call 5.7s
🟢 compaction.e2e.ts · 1 passed 1 step · 1 call 4.5s
🟢 /compact replaces the old chat with a summary 1 step · 1 call 4.5s
🟢 pluginTrustRestart.e2e.ts · 1 passed 4 steps · 2 calls 13.0s
🟢 a trusted plugin hook stays trusted after the server restarts 4 steps · 2 calls 13.0s
🟢 settingsRoundTrip.e2e.ts · 1 passed 2 steps · 1 call 9.1s
🟢 a chat survives trips through Settings 2 steps · 1 call 9.1s
🟢 sidebarPerWorkspace.e2e.ts · 1 passed 4 steps · 1 call 4.1s
🟢 a new workspace starts with its right sidebar collapsed while another keeps it open 4 steps · 1 call 4.1s
🟢 smoke.e2e.ts · 1 passed 2 steps · 1 call 2.9s
🟢 the agent opens the playground workspace 2 steps · 1 call 2.9s
🟢 streamErrors.e2e.ts · 1 passed 1 step · 1 call 6.8s
🟢 stream errors show in the chat, and the chat recovers 1 step · 1 call 6.8s
🟢 todoNudge.e2e.ts · 1 passed 1 step · 1 call 2.9s
🟢 the agent finishes open TODO items after the turn-end nudge 1 step · 1 call 2.9s
🟢 touchAlignment.e2e.ts · 6 passed 6 steps · 6 calls 23.8s
🟢 the Settings close button is level with the title on a touch screen 390px wide 1 step · 1 call 4.2s
🟢 the Settings close button is level with the title on a touch screen 768px wide 1 step · 1 call 4.7s
🟢 Backup settings checkboxes are small and level with their labels on a touch phone 1 step · 1 call 4.3s
🟢 the heartbeat checkbox is small and level with its label on a touch phone 1 step · 1 call 3.3s
🟢 a reply's model and time stay on one line on a touch phone 1 step · 1 call 3.2s
🟢 the workspace actions menu stays on the title row on a touch phone 1 step · 1 call 4.3s

e2e 0.20.0 · 1m 16s · web · run artifacts

🟢 e2e Electron stories (Haiku): 3 passed

3 agent steps · 3 model calls · 8.0k tokens (32% cached)
Spend: $0.01 of the $1.00 cap (proxy ledger)

All 3 tests in 3 files
Test Agent Time
🟢 electron/deepLink.e2e.ts · 1 passed 1 step · 1 call 8.0s
🟢 a deep link of a second launch starts a chat in the running app 1 step · 1 call 8.0s
🟢 electron/menuBar.e2e.ts · 1 passed 1 step · 1 call 5.6s
🟢 the workspace menu bar is the desktop title bar 1 step · 1 call 5.6s
🟢 electron/smoke.e2e.ts · 1 passed 1 step · 1 call 4.6s
🟢 Xum Electron opens the playground workspace 1 step · 1 call 4.6s

e2e 0.20.0 · 20.5s · electron · run artifacts

🟢 e2e agent repros (Haiku): no tests selected

Spend: $0.00 of the $1.00 cap (proxy ledger)

e2e 0.20.0 · 5.3s · 2 targets (web, phone) · run artifacts

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: a1e93ed64a

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a1e93ed64a

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

…cleLock

A launched task whose agent definition sets subagent.skip_init_hook (the
built-in explore agent) logs "Skipping .xum/init hook (disabled for this
task)" in its background init; one without it (exec) does not. Before this
test, inverting the skip_init_hook check in createUnderTaskTreeLifecycleLock
survived every suite. No production change.

---
_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 6bbffcef6b

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

Copy link
Copy Markdown

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: 6bbffcef6b

ℹ️ 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 thread src/node/services/taskService.createUnderLock.test.ts Outdated
Comment thread src/node/services/taskService.createUnderLock.test.ts
…nderLock tests

The skip_init_hook test now writes an executable .xum/init hook into the test
project that creates a marker file under the test root, and asserts the
marker is absent for explore (skip_init_hook: true) and present for exec,
instead of matching the init log text. setup and setupRowlessParent capture
every background init the launch registers (the host mock's
registerExternalBackgroundInit is a no-op), and afterEach waits for them
before it removes the test root, so no init still runs its shell probes
under a deleted root or into a later test.

---
_Generated with `xum` • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 372a364ca3

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

Copy link
Copy Markdown

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: 372a364ca3

ℹ️ 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 thread src/node/services/taskService.createUnderLock.test.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 859fa5c29e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 859fa5c29e

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 859fa5c29e

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Oct 28, 2026
Merged via the queue into main with commit 6b18615 Oct 28, 2026
63 of 66 checks passed
@ThomasK33
ThomasK33 deleted the refactor/task-create-tests branch October 28, 2026 19:47
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