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

Function build_turn_header

atomic-agent/src/record/mod.rs:949–968  ·  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

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

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