Expand description
The closed set of message roles Codewhale can put on a transcript.
Roles used to be free-form Strings on crate::request::Message, and
four wire adapters each decided independently what an unfamiliar role
meant: two dropped it silently, one forwarded it verbatim for the provider
to reject, one failed closed. Role closes the set so that decision can
be made once, in one table, instead of four times by accident.
Two properties are load-bearing and are covered by tests:
- Byte-identical serialization. A
Roleserializes as exactly the string it replaced and deserializes from any string. Saved transcripts therefore need no schema bump and no migration ladder, and a session written by a newer build still loads here — an unfamiliar role lands inRole::Unrecognizedrather than failing the whole session load. assistant_interruptedstays distinct. The interrupted-assistant sentinel is its own variant, not a flavour ofRole::Assistant, so it keeps round-tripping as a separate session item.
Enums§
- Role
- Who authored a message in a transcript.