fix(compile): normalize absolute input paths in generate_header_comment#645
Merged
jamesadevine merged 2 commits intoMay 19, 2026
Merged
Conversation
When users invoke `ado-aw compile /absolute/path/to/agents/foo.md`, strip the current working directory prefix so the stored source in the @ado-aw header is a relative path (e.g. `agents/foo.md`). This ensures --source filters and auto-discovery recompile work correctly regardless of how the compiler was invoked. Also adds two new unit tests covering absolute paths under CWD. Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/847594d9-3bf7-4873-b14c-e072979774b6 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Agent-Logs-Url: https://github.com/githubnext/ado-aw/sessions/847594d9-3bf7-4873-b14c-e072979774b6 Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
jamesadevine
May 19, 2026 10:20
View session
jamesadevine
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When invoking
ado-aw compile /absolute/path/to/agents/foo.md, the full absolute path was stored verbatim in the# @ado-aw source=header. This broke--source agents/foo.mdfilter matching and auto-discovery recompile, since neither could strip the absolute prefix to produce a match.Root cause:
generate_header_commentstripped leading./prefixes but never handled absolute paths.Fix:
generate_header_comment(src/compile/common.rs), ifinput_pathis absolute, strip thecurrent_dir()prefix viaPath::strip_prefixbefore storing the source value. Falls back to the original path if it's not under CWD (unusual edge case).Test plan
Two new unit tests in
src/compile/common.rs:test_generate_header_comment_absolute_path_under_cwd—cwd/agents/my-agent.md→agents/my-agent.mdtest_generate_header_comment_absolute_path_subdir—cwd/.azdo/pipelines/review.md→.azdo/pipelines/review.mdAll existing header comment tests continue to pass (
cargo test test_generate_header_comment).