fix(agents): honor hook bootstrap content#77501
Conversation
|
Codex review: needs maintainer review before merge. Summary Reproducibility: yes. from source inspection: current main routes from filesystem bootstrap-pending state before Next step before merge Security Review detailsBest possible solution: Land this PR after ordinary maintainer review so hook-injected Do we have a high-confidence way to reproduce the issue? Yes, from source inspection: current main routes from filesystem bootstrap-pending state before Is this the best way to solve the issue? Yes. Preloading hook-adjusted bootstrap files before routing is the narrow maintainable fix, and the PR adds focused routing and context-engine coverage for the affected seam. What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 06056926a099. |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
62ba84a to
6dd5ad4
Compare
|
Merged as be8b4dc. Squash-merged with co-author trailers for @ificator (PR author) and @galiniliev (reviewer). Review: no findings. All CI checks green. Rebased onto main to resolve changelog conflicts before merge. |
* Problem: `agent:bootstrap` hooks can inject `BOOTSTRAP.md` content, but embedded-runner bootstrap routing decided whether bootstrap was pending before hook-adjusted files were considered. * Fix: preload hook-adjusted bootstrap files before routing, treat non-empty hook-provided `BOOTSTRAP.md` as pending and accessible bootstrap content, and reuse the preloaded files when building Project Context. * Tests: added routing + context-engine regression coverage for hook-injected bootstrap content. Co-authored-by: ificator <8387253+ificator@users.noreply.github.com> Co-authored-by: galiniliev <galini@microsoft.com>
Summary
Describe the problem and fix in 2-5 bullets:
agent:bootstraphooks can injectBOOTSTRAP.mdcontent, but embedded-runner bootstrap routing decided whether bootstrap was pending before hook-adjusted files were considered.BOOTSTRAP.mdas pending and accessible bootstrap content, and reuse the preloaded files when building Project Context.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
For bug fixes or regressions, explain why this happened, not just what changed. Otherwise write
N/A. If the cause is unclear, writeUnknown.resolveAttemptWorkspaceBootstrapRouting()only used filesystem/workspace bootstrap pending state, whileagent:bootstraphook output was resolved later by Project Context generation.BOOTSTRAP.mdcontent before this change.Regression Test Plan (if applicable)
For bug fixes or regressions, name the smallest reliable test coverage that should catch this. Otherwise write
N/A.src/agents/pi-embedded-runner/run/attempt.spawn-workspace.bootstrap-routing.test.tsBOOTSTRAP.mdcontent injected byagent:bootstrapselects full bootstrap mode and is included in system Project Context, including when normal file read access is unavailable.src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-injection.test.tscovers that full bootstrap mode bypasses continuation-skip behavior.User-visible / Behavior Changes
Hook-provided required bootstrap instructions are now included in the system prompt when
agent:bootstrapinjects non-emptyBOOTSTRAP.mdcontent.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation: N/ARepro + Verification
Environment
Steps
agent:bootstraphook that returns non-emptyBOOTSTRAP.mdcontent for a workspace without filesystem-pending bootstrap state.Expected
BOOTSTRAP.mdcontent makes bootstrap pending and required setup instructions are included in the system prompt.Actual
Evidence
Attach at least one:
Focused verification run:
Changed-gate proof:
Human Verification (required)
What you personally verified (not just CI), and how:
BOOTSTRAP.mdtriggers full bootstrap mode; hook-provided content remains usable when normal file reads are unavailable; empty hook-providedBOOTSTRAP.mddoes not mark bootstrap pending.Review Conversations
If a bot review conversation is addressed by this PR, resolve that conversation yourself. Do not leave bot review conversation cleanup for maintainers.
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
BOOTSTRAP.mdcould accidentally force bootstrap.