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

Function build_turn_header

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

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

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