Skip to content

fix(artifacts): fail open when optional stats cannot be written - #216

Open
hxy91819 wants to merge 1 commit into
vincentkoc:mainfrom
hxy91819:feature/artifact-stats-fail-open
Open

fix(artifacts): fail open when optional stats cannot be written#216
hxy91819 wants to merge 1 commit into
vincentkoc:mainfrom
hxy91819:feature/artifact-stats-fail-open

Conversation

@hxy91819

Copy link
Copy Markdown
Contributor

Summary

  • make recordStats metadata writes best effort
  • preserve raw output and child exit codes when the artifact directory is unavailable
  • keep explicit --store failures strict
  • apply the same fail-open behavior to Codex immediate skip stats

Root cause

Optional telemetry used the same strict metadata writer as explicit artifact storage. An EROFS or ENOTDIR error therefore replaced an already completed command result, including explicit raw output.

Tests

  • env -u TOKENJUICE_NO_OMISSION pnpm exec vitest run test/core/wrap.test.ts -t "preserves raw output when optional stats cannot be written|keeps explicit artifact storage failures strict"
  • env -u TOKENJUICE_NO_OMISSION pnpm exec vitest run test/hosts/codex.test.ts -t "keeps raw bypasses fail-open when optional stats cannot be written"
  • pnpm lint
  • pnpm typecheck
  • packaged CLI probe with TOKENJUICE_ARTIFACT_DIR pointing at an existing file: raw marker and exit 7 preserved

Impact

No documentation, packaging, or release behavior changes. Explicit storage remains strict.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

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.

2 participants