Skip to content

Add thread metadata update endpoint to app server#13280

Merged
joeytrasatti-openai merged 19 commits intomainfrom
joeytrasatti-openai/codex-app-update-metadata-endpoint
Mar 3, 2026
Merged

Add thread metadata update endpoint to app server#13280
joeytrasatti-openai merged 19 commits intomainfrom
joeytrasatti-openai/codex-app-update-metadata-endpoint

Conversation

@joeytrasatti-openai
Copy link
Contributor

@joeytrasatti-openai joeytrasatti-openai commented Mar 2, 2026

Summary

  • add the v2 thread/metadata/update API, including protocol/schema/TypeScript exports and app-server docs
  • patch stored thread gitInfo in sqlite without resuming the thread, with validation plus support for explicit null clears
  • repair missing sqlite thread rows from rollout data before patching, and make those repairs safe by inserting only when absent and updating only git columns so newer metadata is not clobbered
  • keep sqlite authoritative for mutable thread git metadata by preserving existing sqlite git fields during reconcile/backfill and only using rollout SessionMeta git fields to fill gaps
  • add regression coverage for the endpoint, repair paths, concurrent sqlite writes, clearing git fields, and rollout/backfill reconciliation
  • fix the login server shutdown race so cancelling before the waiter starts still terminates block_until_done() correctly

Testing

  • cargo test -p codex-state apply_rollout_items_preserves_existing_git_branch_and_fills_missing_git_fields
  • cargo test -p codex-state update_thread_git_info_preserves_newer_non_git_metadata
  • cargo test -p codex-core backfill_sessions_preserves_existing_git_branch_and_fills_missing_git_fields
  • cargo test -p codex-app-server thread_metadata_update
  • cargo test
    • currently fails in existing codex-core grep-files tests with unsupported call: grep_files:
      • suite::grep_files::grep_files_tool_collects_matches
      • suite::grep_files::grep_files_tool_reports_empty_results

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

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

@joeytrasatti-openai
Copy link
Contributor Author

@codex please review

Copy link
Contributor

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: bda2a91a2d

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

@joeytrasatti-openai
Copy link
Contributor Author

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

github-actions bot added a commit that referenced this pull request Mar 2, 2026
@joeytrasatti-openai joeytrasatti-openai force-pushed the joeytrasatti-openai/codex-app-update-metadata-endpoint branch from e4ddbd8 to f9be532 Compare March 2, 2026 23:47
@joeytrasatti-openai
Copy link
Contributor Author

@codex please review

Copy link
Contributor

@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

Here are some automated review suggestions for this pull request.

Reviewed commit: 2960cc9c91

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

builder.sandbox_policy = config_snapshot.sandbox_policy.clone();
builder.approval_mode = config_snapshot.approval_policy;
let metadata = builder.build(model_provider.as_str());
if let Err(err) = state_db_ctx.insert_thread_if_absent(&metadata).await
Copy link
Collaborator

Choose a reason for hiding this comment

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

actually, do we need to do this whole ensure thread exists in sqlite part? or can we expect all threads to be backfilled at this point cc @jif-oai

Copy link
Collaborator

Choose a reason for hiding this comment

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

not a blocking comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

have not removed this yet

@owenlin0 owenlin0 requested a review from jif-oai March 3, 2026 21:17
@joeytrasatti-openai joeytrasatti-openai merged commit 935754b into main Mar 3, 2026
31 checks passed
@joeytrasatti-openai joeytrasatti-openai deleted the joeytrasatti-openai/codex-app-update-metadata-endpoint branch March 3, 2026 23:56
@github-actions github-actions bot locked and limited conversation to collaborators Mar 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants