Skip to content

[codex] add workspace snapshot turn metadata#15574

Draft
kliu128 wants to merge 3 commits intomainfrom
kevinliu/dirty-worktree-snapshot
Draft

[codex] add workspace snapshot turn metadata#15574
kliu128 wants to merge 3 commits intomainfrom
kevinliu/dirty-worktree-snapshot

Conversation

@kliu128
Copy link

@kliu128 kliu128 commented Mar 23, 2026

Summary

  • add the under-development git_workspace_snapshot feature flag
  • attach workspace_snapshot_commit_hash to async turn metadata when the feature is enabled
  • compute the snapshot hash from a temporary alternate index and a deterministic synthetic commit, always including untracked files
  • add unit and integration coverage plus the matching config schema update
  • remove the stray top-level plan.md from the worktree branch

Why

Codex currently records HEAD and has_changes, but it does not expose a stable identifier for the actual dirty workspace state. This change adds that identifier without moving the work onto the session-start path.

User Impact

When git_workspace_snapshot is enabled, turn metadata includes a workspace_snapshot_commit_hash that equals HEAD for a clean repo and a synthetic snapshot commit hash for a dirty repo.

Validation

  • cargo test -p codex-features
  • RUSTY_V8_ARCHIVE=/Users/kevin.liu/code/codex/codex-rs/target/debug/gn_out/obj/librusty_v8.a cargo test -p codex-core --lib workspace_snapshot_commit
  • RUSTY_V8_ARCHIVE=/Users/kevin.liu/code/codex/codex-rs/target/debug/gn_out/obj/librusty_v8.a cargo test -p codex-core --test responses_headers responses_stream_includes_workspace_snapshot_commit_hash_when_feature_enabled -- --exact
  • RUSTY_V8_ARCHIVE=/Users/kevin.liu/code/codex/codex-rs/target/debug/gn_out/obj/librusty_v8.a cargo test -p codex-core config::schema::tests::config_schema_matches_fixture -- --exact
  • RUSTY_V8_ARCHIVE=/Users/kevin.liu/code/codex/codex-rs/target/debug/gn_out/obj/librusty_v8.a cargo test -p codex-core
    • this full package run still showed unrelated existing failures in arc_monitor, plugin sync, and js_repl tests; the snapshot-related tests passed
  • RUSTY_V8_ARCHIVE=/Users/kevin.liu/code/codex/codex-rs/target/debug/gn_out/obj/librusty_v8.a just fix -p codex-core
  • just fmt

Notes

  • just argument-comment-lint could not run in this checkout because tools/argument-comment-lint/run-prebuilt-linter.sh is missing.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@kliu128
Copy link
Author

kliu128 commented Mar 23, 2026

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Mar 23, 2026
@etraut-openai etraut-openai added the oai PRs contributed by OpenAI employees label Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

oai PRs contributed by OpenAI employees

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants