MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / transition_from_active_recorded

Function transition_from_active_recorded

atomic-agent/src/turn/phase.rs:527–557  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

525}
526
527fn transition_from_active_recorded(event: Event) -> TransitionResult {
528 match event {
529 // Turn start while active+recorded → Ctrl-C recovery
530 // Same as Active + TurnStart: previous turn was interrupted after
531 // a mid-turn record. Transition back to Active for the new turn.
532 Event::TurnStart => {
533 TransitionResult::with_actions(Phase::Active, vec![Action::UpdateInteraction])
534 }
535
536 // Turn ended after mid-turn record → record the turn
537 Event::TurnEnd => TransitionResult::with_actions(
538 Phase::Idle,
539 vec![Action::RecordTurn, Action::UpdateInteraction],
540 ),
541
542 // Another record while already in active+recorded → stay, update
543 Event::Recorded => {
544 TransitionResult::with_actions(Phase::ActiveRecorded, vec![Action::UpdateInteraction])
545 }
546
547 // Another session started → warn
548 Event::SessionStart => {
549 TransitionResult::with_actions(Phase::ActiveRecorded, vec![Action::WarnStaleSession])
550 }
551
552 // Session stopped → end
553 Event::SessionStop => {
554 TransitionResult::with_actions(Phase::Ended, vec![Action::UpdateInteraction])
555 }
556 }
557}
558
559fn transition_from_ended(event: Event, ctx: TransitionContext) -> TransitionResult {
560 match event {

Callers 1

transitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected