Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Submit Run task prompt picker should only search requirement prompts

Open Beginner friendly
#1,267 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@cedricvidal is already working on this.

Since Jul 29, 2026.

  • #1308 by @cedricvidal — open

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

author: cedricvidal bug portal

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

  1. Open http://localhost:5112/runs/new.
  2. In the Scenario section, find Task *.
  3. Use the search input with placeholder Search existing task prompts….
  4. 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"]
  • select is labeled Requirements

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-494
  • apps/api/src/routes/task-prompts.ts:70-95
  • packages/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-74
  • packages/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 select as Requirements: packages/shared/src/types/types.ts:29-34
  • Portal gate metadata labels select as Requirements: 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.tsx
  • apps/portal/src/components/TaskPromptPicker.tsx
  • apps/portal/src/lib/api.ts
  • apps/api/src/routes/task-prompts.ts
  • packages/shared/src/task-prompts/task-prompt-store.ts
  • packages/shared/src/types/types.ts
  • packages/shared/src/schemas/prompt-type.ts
Dominant language
TypeScript
Stars
7
Forks
13
Avg merge
3d 16h
Merged PRs (30d)
29

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/scope

All issues in microsoft/scope

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.