Submit Run task prompt picker should only search requirement prompts
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start at apps/portal/src/pages/SubmitRun.tsx:821 and compare the existing typed picker usages in the same file. Check apps/portal/src/components/TaskPromptPicker.test.tsx and add or adjust a portal test for the Task picker’s API request. Done means the Task field sends type "select" and search results exclude non-requirement prompt types.
Written by the indexing model from the issue text.
Description
Original author: @cedricvidal
Summary
On /runs/new, the Task * search input (placeholder="Search existing task prompts…") returns task prompts of all prompt types. It should only return requirement/task prompts.
Note: this was discovered while working on per-project data organization, but it is a standalone portal bug unrelated to that work.
Steps to Reproduce
- Open
http://localhost:5112/runs/new. - In the Scenario section, find Task *.
- Use the search input with placeholder
Search existing task prompts…. - Search for text that exists in non-requirement prompt types, such as AGENTS.md or gate prompts.
Expected behavior
The Task * picker should only show requirement/task prompts.
In the current prompt type model, the requirement/task prompt type is select:
PROMPT_TYPES = ["select", "build", "test", "run", "deploy", "agents.md"]selectis labeledRequirements
Actual behavior
The picker returns prompts across all prompt types, including non-requirement prompts such as agents.md, build, test, run, and deploy.
Root cause / technical pointers
The Task * field renders TaskPromptPicker without a type prop:
apps/portal/src/pages/SubmitRun.tsx:821
<TaskPromptPicker onSelect={(text) => setTask(text)} />
Because no type is passed, TaskPromptPicker calls api.listTaskPrompts with type undefined:
apps/portal/src/components/TaskPromptPicker.tsx:25-28
queryFn: () => api.listTaskPrompts({ search: query || undefined, limit: 8, type }),
The portal API client already supports a type query param, and the server endpoint accepts it and forwards it to the store, which only filters when type is provided:
apps/portal/src/lib/api.ts:486-494apps/api/src/routes/task-prompts.ts:70-95packages/shared/src/task-prompts/task-prompt-store.ts:174-198
if (opts?.type) {
filter.type = opts.type;
}
So the root cause is that the Submit Run task picker does not constrain the prompt type, even though the client, server, and store already support a type filter.
Prompt type system
Allowed prompt type values are defined in shared:
packages/shared/src/types/types.ts:62-74packages/shared/src/schemas/prompt-type.ts:12
Allowed values: select, build, test, run, deploy, agents.md.
select is the requirement/task prompt type:
- Shared gate metadata labels
selectasRequirements:packages/shared/src/types/types.ts:29-34 - Portal gate metadata labels
selectasRequirements:apps/portal/src/lib/gates.ts:37-42 - Migration 019 states existing task prompts are the Select gate / request task:
packages/db-migrations/src/migrations/019-backfill-task-prompt-type.ts
There is no literal prompt type named requirement; the current discriminator for requirement/task prompts is select.
Existing patterns to reference
Other picker usages already pass a type, confirming the intended pattern:
- AGENTS.md picker passes
type="agents.md":apps/portal/src/pages/SubmitRun.tsx:1047-1050 - Gate prompt pickers pass
type={gate}:apps/portal/src/pages/SubmitRun.tsx:1142-1145 - Task prompt list applies a type filter:
apps/portal/src/pages/TaskPromptList.tsx:75-80 - Picker test expects
type: "agents.md":apps/portal/src/components/TaskPromptPicker.test.tsx:43-53 - API endpoint test verifies
?type=agents.md:apps/api/src/endpoints.test.ts:1414-1422
Suggested fix
Primary fix in apps/portal/src/pages/SubmitRun.tsx:821, pass the requirement prompt type to the task picker:
<TaskPromptPicker type="select" onSelect={(text) => setTask(text)} />
Add/adjust a portal test to assert the Task * picker calls api.listTaskPrompts({ search: ..., limit: 8, type: "select" }).
Robustness follow-up to consider: whether TaskPromptStore.getAll({ type: "select" }) should also include legacy untyped docs (a select-missing-type precedent exists in apps/api/src/routes/prompt-features.ts:165-175). Relevant store code: packages/shared/src/task-prompts/task-prompt-store.ts:174-198.
Affected files
apps/portal/src/pages/SubmitRun.tsxapps/portal/src/components/TaskPromptPicker.tsxapps/portal/src/lib/api.tsapps/api/src/routes/task-prompts.tspackages/shared/src/task-prompts/task-prompt-store.tspackages/shared/src/types/types.tspackages/shared/src/schemas/prompt-type.ts
- Dominant language
- TypeScript
- Stars
- 7
- Forks
- 13
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 29
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/scope
-
type: worker-update
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 2 days
-
type: worker-update
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 2 days
-
type: worker-update
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
Clarify that prompt features only categorize prompts, don't impact runsPossibly taken @DerrickUnleashed claimed this 4 days ago. Openauthor: JaGord documentation good first issue UI
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
author: waldekmastykarz bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
Similar issues
-
ble-needs-fable-review bug mobile priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ColeMurray/background-agents#2305 ·
Maintainers usually reply within 1 day
-
bug from-studio
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
esengine/DeepSeek-Reasonix#12355 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
oblien/openship#1086 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day