Skip to content

Add ephemeral flag support to thread fork#14248

Merged
joeytrasatti-openai merged 2 commits intomainfrom
joeytrasatti-openai/codex-app-add-ephemeral-flag-to-threadfork
Mar 10, 2026
Merged

Add ephemeral flag support to thread fork#14248
joeytrasatti-openai merged 2 commits intomainfrom
joeytrasatti-openai/codex-app-add-ephemeral-flag-to-threadfork

Conversation

@joeytrasatti-openai
Copy link
Contributor

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

Summary

This PR adds first-class ephemeral support to thread/fork, bringing it in line with thread/start. The goal is to support one-off completions on full forked threads without persisting them as normal user-visible threads.

Testing

#[ts(optional = nullable)]
pub developer_instructions: Option<String>,
#[ts(optional = nullable)]
pub ephemeral: Option<bool>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can do this for booleans which results in slightly cleaner generated types (field?: boolean instead of field?: boolean | null and server behavior (it's in AGENTS.md):

When you want omission to mean false for boolean fields, use #[serde(default, skip_serializing_if = "std::ops::Not::not")] pub field: bool over Option<bool>.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Got it - have updated to be optional, non null

thread.turns = build_turns_from_rollout_items(&history_items);
thread
};
// forked thread names do not inherit the source thread name
Copy link
Collaborator

Choose a reason for hiding this comment

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

we lost this comment, could we restore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes will restore!

return;
}
}
} else {
Copy link
Collaborator

@owenlin0 owenlin0 Mar 10, 2026

Choose a reason for hiding this comment

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

it's a bit hard to parse what the two branches are, could we add some comments? Or better yet, could we reuse a helper somehow? i.e. rename the populate_resume_turns helper (since ideally we could use it for resuming and forking a thread?) and leverage it for thread/fork perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to populate_thread_turns and using that!

@joeytrasatti-openai joeytrasatti-openai changed the title [codex-app] Add ephemeral flag support to thread fork Add ephemeral flag support to thread fork Mar 10, 2026
@joeytrasatti-openai joeytrasatti-openai merged commit e4bc352 into main Mar 10, 2026
34 of 35 checks passed
@joeytrasatti-openai joeytrasatti-openai deleted the joeytrasatti-openai/codex-app-add-ephemeral-flag-to-threadfork branch March 10, 2026 23:34
@github-actions github-actions bot locked and limited conversation to collaborators Mar 10, 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