fix(runner): validate execution artifacts and standardize tooling#1
fix(runner): validate execution artifacts and standardize tooling#1
Conversation
There was a problem hiding this comment.
💡 Codex Review
devagent-runner/packages/local-runner/src/index.ts
Lines 342 to 345 in e579bd7
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".
| protocolVersion: PROTOCOL_VERSION, | ||
| type: "completed", | ||
| at: new Date().toISOString(), | ||
| taskId: request.taskId, | ||
| status, |
There was a problem hiding this comment.
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 👍 / 👎.
Summary:
Validation: