Add ephemeral flag support to thread fork#14248
Conversation
| #[ts(optional = nullable)] | ||
| pub developer_instructions: Option<String>, | ||
| #[ts(optional = nullable)] | ||
| pub ephemeral: Option<bool>, |
There was a problem hiding this comment.
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
falsefor boolean fields, use#[serde(default, skip_serializing_if = "std::ops::Not::not")] pub field: booloverOption<bool>.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
we lost this comment, could we restore?
There was a problem hiding this comment.
yes will restore!
| return; | ||
| } | ||
| } | ||
| } else { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
renamed to populate_thread_turns and using that!
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