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

Function build_turn_header

atomic-agent/src/record/mod.rs:1529–1548  ·  view source on GitHub ↗

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],
)

Source from the content-addressed store, hash-verified

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.
1529fn 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

Callers 3

record_turnFunction · 0.85
test_header_has_messageFunction · 0.85
test_header_has_authorFunction · 0.85

Calls 6

build_turn_messageFunction · 0.85
resolve_agent_authorFunction · 0.85
authorMethod · 0.80
cloneMethod · 0.45
buildMethod · 0.45
messageMethod · 0.45

Tested by 2

test_header_has_messageFunction · 0.68
test_header_has_authorFunction · 0.68