fix: filter boundary sentinel from system-prompt sections JSON

__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__ is now filtered from the sections
array in JSON output. boundary_index field exposed for callers that
need the static/dynamic split point.

Generated with https://github.com/Yeachan-Heo/gajae-code
Co-authored-by: Gajae Code <dev@gajae-code.com>
This commit is contained in:
bellman
2026-06-05 02:32:14 +09:00
parent 0ce4168c93
commit 3f50f33407
2 changed files with 15 additions and 3 deletions

View File

@@ -4691,6 +4691,16 @@ fn print_system_prompt(
",
);
// #418: filter out the internal boundary sentinel from the sections array
// and expose the boundary index as a structured field.
let filtered_sections: Vec<&str> = sections
.iter()
.filter(|s| !s.contains("__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__"))
.map(|s| s.as_str())
.collect();
let boundary_index = sections
.iter()
.position(|s| s.contains("__SYSTEM_PROMPT_DYNAMIC_BOUNDARY__"));
match output_format {
CliOutputFormat::Text => println!("{message}"),
CliOutputFormat::Json => println!(
@@ -4700,13 +4710,15 @@ fn print_system_prompt(
"action": "show",
"status": "ok",
"message": message,
"sections": sections,
"sections": filtered_sections,
"boundary_index": boundary_index,
"memory_file_count": memory_files.len(),
"memory_files": memory_files_json(&memory_files),
}))?
),
}
Ok(())
}
fn print_version(output_format: CliOutputFormat) -> Result<(), Box<dyn std::error::Error>> {