Skip to content

fix(runner): validate execution artifacts and standardize tooling#1

Merged
egavrin merged 2 commits intomainfrom
codex/mar10-cleanup
Mar 10, 2026
Merged

fix(runner): validate execution artifacts and standardize tooling#1
egavrin merged 2 commits intomainfrom
codex/mar10-cleanup

Conversation

@egavrin
Copy link
Owner

@egavrin egavrin commented Mar 10, 2026

Summary:

  • consolidate tracked run handles and validate persisted protocol payloads
  • replace sync event log writes and harden missing result.json behavior
  • move runner tests to Vitest and add eslint config

Validation:

  • bun run test
  • bun run lint

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

}).catch(async (error: unknown) => {
metadata.status = "failed";
await writeFile(join(runsDir, `${handle.id}.json`), JSON.stringify(metadata, null, 2));
this.activeRuns.delete(handle.id);

P2 Badge Flush pending event-log writes in failed-run cleanup

Event persistence is now asynchronous (eventLogWrite), but the rejection path skips flushEventLog() before marking the run failed and removing it from activeRuns. If handle.wait() rejects shortly after emitting events, callers that inspect/subscribe immediately can read a partially written log because appends are still in flight. The failure path should await the same flush used in the success path to keep failed-run logs durable and ordered.

ℹ️ 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 +399 to +403
protocolVersion: PROTOCOL_VERSION,
type: "completed",
at: new Date().toISOString(),
taskId: request.taskId,
status,

Choose a reason for hiding this comment

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

P1 Badge Avoid emitting duplicate completed events on fallback failure

In DevAgentAdapter.launch, this fallback completed emission runs unconditionally whenever result.json is missing, even if a completed event was already streamed and forwarded from stdout earlier in the same run. In the failure mode where DevAgent emits protocol events but fails to persist result.json (for example, a late artifact write error), subscribers will receive multiple terminal events with conflicting statuses, which can double-trigger downstream handlers or overwrite previously finalized run state.

Useful? React with 👍 / 👎.

@egavrin egavrin merged commit e0a5884 into main Mar 10, 2026
1 check passed
@egavrin egavrin deleted the codex/mar10-cleanup branch March 10, 2026 11:23
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