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

Function build_turn_header

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

(
    options: &TurnRecordOptions<'_>,
    status: &RepositoryStatus,
    untracked_paths: &[String],
)

Source from the content-addressed store, hash-verified

90///
91/// The author is the agent identity.
92fn build_turn_header(
93 options: &TurnRecordOptions<'_>,
94 status: &RepositoryStatus,
95 untracked_paths: &[String],
96) -> ChangeHeader {
97 let message = build_turn_message(options, status, untracked_paths);
98
99 let author = build_agent_author(
100 &options.session.agent_name,
101 &options.session.agent_display_name,
102 &options.session.session_id,
103 );
104
105 ChangeHeader::builder()
106 .message(message)
107 .author(author)
108 .build()
109}
110
111// record_turn (the main entry point)
112

Callers 3

record_turnFunction · 0.85
test_header_has_messageFunction · 0.85
test_header_has_authorFunction · 0.85

Calls 5

build_turn_messageFunction · 0.85
build_agent_authorFunction · 0.85
authorMethod · 0.80
buildMethod · 0.45
messageMethod · 0.45

Tested by 2

test_header_has_messageFunction · 0.68
test_header_has_authorFunction · 0.68