-
Notifications
You must be signed in to change notification settings - Fork 236
[BUG] managed_section ignored when compilation.strategy=distributed (default) #1764
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/highShips in current or next milestoneShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.Something does not work as documented.
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).priority/highShips in current or next milestoneShips in current or next milestonestatus/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.Something does not work as documented.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
StatusShow more project fields
In Progress
Managed-section mode is implemented in PR #1589 but only wired to the legacy single-file write path.
Repro
apm.yml:AGENTS.mdwith<!-- apm:start -->/<!-- apm:end -->markers plus human-written content outside the markers.apm compile(defaultstrategy: distributed).Expected: only the block between markers is replaced, hand-written content is preserved.
Actual: the entire
AGENTS.mdis overwritten.Root cause
agents_compiler.py::_compile_single_file()calls_write_output_file_with_config()(honorsmanaged_section).agents_compiler.py::_compile_distributed()(default strategy since Task 7) writes files viaDistributedAgentsCompilerwhich has no managed-section handling.--single-agents,commands/compile/cli.pytakes a dry-run/intermediate path and writes viaCompiledOutputWriter().write()directly, bypassing_write_output_file_with_config().So the helper
apply_managed_section()exists and is correct, but the active compile paths don't invoke it.Suggested fix
Route distributed (and single-file CLI) AGENTS.md writes through
_write_output_file_with_config()when the target file is the rootAGENTS.md.Environment