Remove automatic README loading from context window

README.md is no longer auto-loaded into the LLM context at startup.
This saves ~4,600 tokens per session while AGENTS.md and memory.md
still provide all critical information for code tasks.

Changes:
- Delete read_project_readme() function
- Remove readme_content parameter from combine_project_content()
- Rename extract_readme_heading() -> extract_project_heading()
- Rename Agent constructors: *_with_readme_* -> *_with_project_context_*
- Update context preservation to only check for Agent Configuration
- Remove has_readme field from LoadedContent
- Update all tests to use new markers and function names

The LLM can still read README.md on-demand via read_file when needed.
This commit is contained in:
Dhanji R. Prasanna
2026-01-29 11:07:41 +11:00
parent 05d253ee2a
commit 7bfb9efa19
16 changed files with 113 additions and 174 deletions

View File

@@ -15,7 +15,7 @@ use crate::commands::handle_command;
use crate::display::{LoadedContent, print_loaded_status, print_project_heading, print_workspace_path};
use crate::g3_status::{G3Status, Status};
use crate::project::Project;
use crate::project_files::extract_readme_heading;
use crate::project_files::extract_project_heading;
use crate::simple_output::SimpleOutput;
use crate::template::process_template;
use crate::task_execution::execute_task_with_retry;
@@ -153,11 +153,9 @@ pub async fn run_interactive<W: UiWriter>(
if let Some(ref content) = combined_content {
let loaded = LoadedContent::from_combined_content(content);
// Extract project name if README is loaded
if loaded.has_readme {
if let Some(name) = extract_readme_heading(content) {
print_project_heading(&name);
}
// Extract project name from AGENTS.md or memory
if let Some(name) = extract_project_heading(content) {
print_project_heading(&name);
}
print_loaded_status(&loaded);