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],
)
| 1527 | /// The author is the agent identity — the delegated identity selected for |
| 1528 | /// this hook invocation when one is in force, else the plus-tag fallback. |
| 1529 | fn build_turn_header( |
| 1530 | options: &TurnRecordOptions<'_>, |
| 1531 | status: &RepositoryStatus, |
| 1532 | untracked_paths: &[String], |
| 1533 | ) -> ChangeHeader { |
| 1534 | let message = build_turn_message(options, status, untracked_paths); |
| 1535 | |
| 1536 | let author = crate::identity::resolve_agent_author(&crate::identity::AgentAuthorOptions { |
| 1537 | agent_name: &options.session.agent_name, |
| 1538 | agent_display_name: &options.session.agent_display_name, |
| 1539 | session_id: &options.session.session_id, |
| 1540 | identity_dir: options.identity_dir.clone(), |
| 1541 | agent_identity: options.agent_identity.clone(), |
| 1542 | }); |
| 1543 | |
| 1544 | ChangeHeader::builder() |
| 1545 | .message(message) |
| 1546 | .author(author) |
| 1547 | .build() |
| 1548 | } |
| 1549 | |
| 1550 | // record_turn (the main entry point) |
| 1551 |