Build a `ChangeHeader` for an agent turn./// The message is built from the file changes and prompt context: - Good prompt: `"Fix the authentication bug in login.rs"` - Slash command or no prompt: `"Add src/main.rs, Cargo.toml"` The author is the agent identity — the delegated identity selected for this hook invocation when one is in force, else the plus-tag fallback.
(
options: &TurnRecordOptions<'_>,
status: &RepositoryStatus,
untracked_paths: &[String],
)
| 947 | /// The author is the agent identity — the delegated identity selected for |
| 948 | /// this hook invocation when one is in force, else the plus-tag fallback. |
| 949 | fn build_turn_header( |
| 950 | options: &TurnRecordOptions<'_>, |
| 951 | status: &RepositoryStatus, |
| 952 | untracked_paths: &[String], |
| 953 | ) -> ChangeHeader { |
| 954 | let message = build_turn_message(options, status, untracked_paths); |
| 955 | |
| 956 | let author = crate::identity::resolve_agent_author(&crate::identity::AgentAuthorOptions { |
| 957 | agent_name: &options.session.agent_name, |
| 958 | agent_display_name: &options.session.agent_display_name, |
| 959 | session_id: &options.session.session_id, |
| 960 | identity_dir: options.identity_dir.clone(), |
| 961 | agent_identity: options.agent_identity.clone(), |
| 962 | }); |
| 963 | |
| 964 | ChangeHeader::builder() |
| 965 | .message(message) |
| 966 | .author(author) |
| 967 | .build() |
| 968 | } |
| 969 | |
| 970 | // record_turn (the main entry point) |
| 971 |