d61cff60e3
The on-demand subdirectory hint loader (agent/subdirectory_hints.py, #5291) tail-chopped anything past 8,000 chars with a bare marker and no log line. apps/desktop/AGENTS.md (11k) has been arriving cut off in every Desktop-area session since it was written, and nobody could tell. Compared with the field: Codex caps its whole instruction chain at 32 KiB (project_doc_max_bytes) and documents it; Claude Code and Cursor apply no cap to nested files; OpenCode has no nested discovery at all. Our on-demand + cache-safe + ancestor-walk design is the strongest of the four; only the constant and the silent cut were wrong. Now: ceiling 32,000 chars (Codex's number, a guard against a stray huge CLAUDE.md in a vendored tree, not a target), and truncation goes through prompt_builder._truncate_content — head 70% + tail 20%, a marker naming the file to read_file for the rest, and a WARNING in the log. Area AGENTS.md files should stay around 8k anyway: the text lands in a tool result on the first touch of the directory. Tests: oversized hint keeps head+tail, names the path, and logs; a 12k area file (over the old cap, under the new) arrives intact.