pub struct TurnRecord {
pub role: String,
pub model: String,
pub text: String,
pub tool_calls: Vec<String>,
pub ran_test_command: bool,
pub usage: TokenUsage,
}Expand description
One recorded assistant turn for the run transcript.
Why: The transcript output needs a machine- and human-renderable shape that
captures who spoke (role), with which model, what text, and which tools it
invoked — enough to reconstruct the PM→engineer interaction without leaking
the full raw message history.
What: role is the agent label; model is the resolved slug for that turn;
text is the assistant prose (empty for tool-only turns); tool_calls lists
the invoked tool names in order; ran_test_command (#2279) is a summarized
signal — true iff this turn’s tool calls included a bash invocation
matching crate::verify_gate::is_test_command — the delegating PM’s own
verify_gate::pm_finish_gate consults this instead of the engineer’s full
transcript, since the PM never calls bash itself; usage is the token
usage the provider reported for this turn (the per-turn unit the run
aggregates over both PM and engineer turns, since the engineer’s usage is
otherwise lost when its output flows back to the PM as a tool-result
string). Deserialize (#2060) lets tcode’s CLI thin client parse a
session.get_transcript JSON-RPC result straight back into
Vec<TurnRecord>.
Test: run_task::tests::end_to_end_pm_delegates_to_engineer,
verify_gate::tests::pm_gate_satisfied_when_engineer_ran_tests.
Fields§
§role: StringAgent label that produced this turn (e.g. "pm", "python-engineer").
model: StringResolved model slug used for this turn.
text: StringAssistant prose for the turn (empty string for tool-only turns).
tool_calls: Vec<String>Names of tools the assistant called this turn, in order.
ran_test_command: boolWhether this turn ran a bash command matching #2279’s verify-before-
finish test-command pattern. #[serde(default)] keeps a pre-#2279
persisted transcript deserialising cleanly with this flag false.
usage: TokenUsageToken usage the provider reported for this turn.
Trait Implementations§
Source§impl Clone for TurnRecord
impl Clone for TurnRecord
Source§fn clone(&self) -> TurnRecord
fn clone(&self) -> TurnRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TurnRecord
impl Debug for TurnRecord
Source§impl<'de> Deserialize<'de> for TurnRecord
impl<'de> Deserialize<'de> for TurnRecord
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TurnRecord
impl PartialEq for TurnRecord
Source§impl Serialize for TurnRecord
impl Serialize for TurnRecord
impl StructuralPartialEq for TurnRecord
Auto Trait Implementations§
impl Freeze for TurnRecord
impl RefUnwindSafe for TurnRecord
impl Send for TurnRecord
impl Sync for TurnRecord
impl Unpin for TurnRecord
impl UnsafeUnpin for TurnRecord
impl UnwindSafe for TurnRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more