Repository navigation
[AI-7080] Give agents the PRD as a path - #25181
luisorofino wants to merge 1 commit into
Conversation
|
✅ All CI checks and tests passed. 🎉 All green!🧪 All tests passed 🎯 Code Coverage (details) 🔗 Commit SHA: 4676e77 | Docs | View more details | Give us feedback! |
evalya-impact-summaryevalya impact analysis |
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
ddb616b to
5c038a1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c038a13e9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| input_type=InputType.PATH, | ||
| required=True, | ||
| as_content=True, | ||
| snapshot=True, |
There was a problem hiding this comment.
Preserve a selected snapshot before clearing the run directory
When a fresh launch uses a PRD located under that flow's existing .ddev/ai-runs/<slug> directory—most notably the inputs/files/prd.* copy from a prior run—the modal accepts the file and returns its path, but ExecutionScreen._build_real_orchestrator() deletes the run directory before PhaseOrchestrator.on_initialize() calls snapshot_path_inputs(). _capture() then raises FileNotFoundError, so a valid captured PRD cannot be reused for a new run; preserve or copy such sources before clearing the directory.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
The .ddev/ai-runs/<slug> dir is not meant to be used as the source of PRD. It's just the "leftover" of previous runs, so you can inspect the logs after. If someone wants to use a PRD, they will have it outside that folder. The files in that folder are either copies of outside ones (like PRDs) or logs and checkpoints from previous runs.
5c038a1 to
d43041c
Compare
d43041c to
40e8c0c
Compare
40e8c0c to
e7bedb5
Compare
The built-in `prd` input becomes a snapshot input, so it is captured once per run and reaches prompts as a path to that copy instead of as inlined text. The PRD was previously interpolated into the worker prompt, the goal, and — via the rendered task prompt the reviewer receives — the goal-review message as well, on every task and every validation retry. A large PRD therefore consumed context repeatedly across a run. The openmetrics prompts that quoted it verbatim now point at the file and require the agent to read it in full first.
e7bedb5 to
4676e77
Compare
AAraKKe
left a comment
There was a problem hiding this comment.
note: Reviewed the PRD input switch and all four OpenMetrics worker/goal prompts against the snapshot-input branch. The prompts require reading the PRD in full, and read_file remains available to the goal reviewers. The focused resolver tests passed (5), as did the selected launch-payload and path-validation tests (3). No new correctness findings in this PR's delta; the snapshot capture requests are on #25180.
|
This pull request has been automatically marked as stale because it has not had activity in the past 15 days. It will be closed in 30 days if no further activity occurs. If this pull request is still relevant, adding a comment or pushing new commits will keep it open. Also, you can always reopen the pull request if you missed the window. Thank you for your contributions! |
Validation ReportAll 22 validations passed. Show details
|
What does this PR do?
Flips the built-in
prdflow input fromas_contenttosnapshot, so it is captured once per run and reaches prompts as a path to that copy instead of as inlined text.The four openmetrics prompts that quoted the PRD verbatim inside a fenced block now name the file and require the agent to read it in full before proceeding:
phase2_code,phase2_code_goal,phase3_tests, andphase3_tests_goal.Test expectations for the launch modal move from the PRD's contents to the path it now converts to. The launch-modal harness exposes that value as
expected_prd, and the flow-screen helper returns it, so the assertion lives in one place per suite rather than in each test that happens to carry a PRD alongside what it is really testing.Motivation
AI-7080.
The PRD was interpolated into three places per task: the worker prompt, the goal, and — through the rendered task prompt that
build_reviewer_user_messageembeds — the goal-review message as well. Every validation retry rebuilt all three. A large PRD was therefore paid for repeatedly across a run, crowding out task-specific context.With a path, an agent loads the requirements when it needs them. The saving is one read per agent context rather than one copy per prompt: a task that clears context before running re-reads the file, which is still far less than inlining it into every turn.
Verified before making the change that all four openmetrics agents already declare the
read_filetool, and that goal reviewers keep it —filter_read_onlypreserves it because it is marked read-only in the tool manifest. The resolution check added in #25180 now enforces that for any future agent.Review checklist (to be filled by reviewers)
qa/requiredif this PR needs QA validation, orqa/skip-qaif it does not. Exactly one of the two is required.backport/<branch-name>label to the PR and it will automatically open a backport PR once this one is merged