Skip to content

fix(sdk): report worker sessions without model progress markers - #962

Merged
mldangelo-oai merged 19 commits into
mainfrom
mdangelo/codex/runtime-worker-events
Oct 7, 2026
Merged

mldangelo-oai merged 19 commits into
mainfrom
mdangelo/codex/runtime-worker-events

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

SDK callers need to know when a scan has delegated work to additional Codex sessions, even when the model emits no progress markers. Add an optional onWorkerEvent callback that reports worker sessions discovered in saved session data, using the existing session tracker and bundled Codex version.

Changes

  • Export ScanWorkerEvent and deliver { kind: "observed", worker: number } once per discovered session per run. The scan-local worker number matches activity and session callbacks.
  • Include nested workers and scan-associated validation and Deep Scan sessions. Keep concurrent scans separate; a resumed run can report workers that were already saved.
  • Report observer failures through onObserverError without stopping the scan, and stop observing workers before post-scan instructions run.
  • Document how this callback differs from the existing model-reported worker status and session-event callbacks. No CLI options are added.

Testing

Recorded SDK checks at 1b7111ed use fixtures that create saved worker metadata without status markers or usage records, then verify one event per worker even after duplicate files and repeated polls. Model text resembling session metadata and sessions belonging to another scan produce no worker events. Separate cases cover concurrent scans, resume, nested workers and consistent numbering across callbacks.

Orchestration tests hold the scan open until the worker event arrives, exercise synchronous and asynchronous observer failures, and verify that post-scan workers are excluded even when the scan or follow-up fails or is interrupted. The installed-package consumer also checks that the callback and event type are exported.

To repeat the focused checks with SDK dependencies installed, run from sdk/typescript:

pnpm run build:plugin
bun test --timeout 30000 tests-ts/api.test.ts tests-ts/cost.test.ts

The full SDK fixed/random pair was not run locally at this head. Native Windows and macOS execution was not performed.

Risk and rollout

The callback is optional. Persistence and polling can delay delivery, and an observed session does not establish when the worker started or whether file review has begun. It does not report failed dispatch attempts or gate worker creation; use the existing signal and cost controls for cancellation. Existing worker-status callbacks remain available, and no migration is required.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

Add a bounded onWorkerEvent observer with shared scan-local worker numbers and dispatch deduplication. Keep marker-derived phase status compatible and document its best-effort delivery. Requires the corresponding Codex runtime event release before shipping.
@github-actions github-actions Bot added the bug Something isn't working label Sep 17, 2026
@mldangelo-oai

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review head b2e08d718d9ee1bf171f05f224550fb386b98e70. This PR remains draft pending the paired runtime release and dependency pin update.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 17, 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-07T05:47:03.045540Z 0391330 New commits
🔒 Security Review ✅ Completed 2026-10-07T05:47:13.544082Z 0391330 New commits
ℹ️ 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 Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: b2e08d718d

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

@mldangelo-oai mldangelo-oai changed the title fix(sdk): expose runtime worker spawn outcomes fix(sdk): report observed worker sessions without status markers Sep 17, 2026
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review September 17, 2026 22:03
@mldangelo-oai mldangelo-oai changed the title fix(sdk): report observed worker sessions without status markers fix(sdk): report worker sessions without model progress markers Oct 7, 2026

@zcrab-oai zcrab-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the diff and relevant surrounding code at 1b7111e, with an independent second pass. No obvious correctness or regression issues found. Full local platform suites were not rerun. CI still has failed, canceled, or unfinished checks; those results remain separate from this source-review approval.

@mldangelo-oai
mldangelo-oai merged commit ff95e67 into main Oct 7, 2026
76 of 92 checks passed
@mldangelo-oai
mldangelo-oai deleted the mdangelo/codex/runtime-worker-events branch October 7, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants