Skip to content

feat: Added ui to support input params for task creation#222

Open
michael-chou359 wants to merge 4 commits intomainfrom
users/michaelchou/task_param_dev_ui
Open

feat: Added ui to support input params for task creation#222
michael-chou359 wants to merge 4 commits intomainfrom
users/michaelchou/task_param_dev_ui

Conversation

@michael-chou359
Copy link
Copy Markdown

@michael-chou359 michael-chou359 commented May 5, 2026

See issue here:

https://linear.app/scale-epd/issue/AGX1-230/default-agentex-gui-support-agents-that-require-parameters-at-task

Added task parameters drop down in the UI
image

Clicking drops down into a json input
image

image

input is passed as additional params to task creation backend call
image

Task Params only available when task is initialized, the ui disappears with subsequent chat messages.

Greptile Summary

  • Adds a collapsible "Task Parameters" JSON editor above the prompt input that only renders when no task is active (!taskID && !isDisabled), allowing users to inject extra key-value pairs into the createTask API call.
  • The extra params are spread before description/content so core fields always win over user-supplied JSON.
  • The feature is missing a process.env.NODE_ENV === 'development' guard on both the UI panel and the parse logic, making it available in all environments despite the stated dev-only intent.

Confidence Score: 4/5

Safe to merge with the dev-only guard added; without it, the feature ships to production contrary to design intent.

One P1 finding: the Task Parameters panel and its extraTaskParams injection are missing a NODE_ENV === 'development' check, exposing the feature in production. No P0 issues present.

agentex-ui/components/primary-content/prompt-input.tsx — needs dev-only environment guard on both the UI block and the extraTaskParams parse path.

Important Files Changed

Filename Overview
agentex-ui/components/primary-content/prompt-input.tsx Adds a collapsible Task Parameters JSON editor to the prompt input for injecting extra params on task creation, but the feature lacks a process.env.NODE_ENV === 'development' guard, making it visible and functional in all environments contrary to the stated design intent.

Sequence Diagram

sequenceDiagram
    participant User
    participant PromptInput
    participant handleSendPrompt
    participant createTaskMutation

    User->>PromptInput: Expand "Task Parameters" panel
    User->>PromptInput: Enter JSON in DataInput (taskParams)
    User->>PromptInput: Enter prompt text
    User->>PromptInput: Click Send / press Enter

    PromptInput->>handleSendPrompt: invoke
    handleSendPrompt->>handleSendPrompt: setPrompt('') — clears main prompt
    alt taskParams is non-empty
        handleSendPrompt->>handleSendPrompt: JSON.parse(taskParams)
        alt Invalid JSON
            handleSendPrompt-->>User: toast.error('Invalid Task Parameters JSON')
            note over handleSendPrompt: returns early — prompt already cleared
        else Valid JSON
            handleSendPrompt->>createTaskMutation: mutateAsync with extraTaskParams spread
            createTaskMutation-->>handleSendPrompt: task
        end
    else taskParams empty
        handleSendPrompt->>createTaskMutation: mutateAsync with description and content only
        createTaskMutation-->>handleSendPrompt: task
    end
Loading

Comments Outside Diff (1)

  1. agentex-ui/components/primary-content/prompt-input.tsx, line 122-133 (link)

    P1 setPrompt('') is called on line 122 before the extraTaskParams JSON parse. If the user's task-params JSON is invalid, the function returns early after showing the toast — but the main prompt text has already been wiped, causing silent data loss.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: agentex-ui/components/primary-content/prompt-input.tsx
    Line: 122-133
    
    Comment:
    `setPrompt('')` is called on line 122 **before** the `extraTaskParams` JSON parse. If the user's task-params JSON is invalid, the function returns early after showing the toast — but the main prompt text has already been wiped, causing silent data loss.
    
    
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Cursor Fix in Claude Code Fix in Codex

Fix All in Cursor Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
agentex-ui/components/primary-content/prompt-input.tsx:181-200
**Missing dev-only guard on Task Parameters UI**

The PR description says "Also only available in dev environment," but neither the UI panel (line 181) nor the `extraTaskParams` parse logic (line 126) has a `process.env.NODE_ENV === 'development'` check. As-is, the Task Parameters accordion and its ability to inject arbitrary JSON into `createTask` are fully live in production, directly contradicting the stated design constraint.

Reviews (4): Last reviewed commit: "added ui to support input params for tas..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@michael-chou359 michael-chou359 requested a review from a team as a code owner May 5, 2026 23:40
Comment thread agentex-ui/components/primary-content/prompt-input.tsx

return (
<div className="flex w-full max-w-3xl flex-col gap-2">
{process.env.NODE_ENV === 'development' && !taskID && (
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's allow this in all envs but hide when the chat is disabled

@michael-chou359 michael-chou359 changed the title Added ui to support input params for task creation in dev environment feat: Added ui to support input params for task creation in dev environment May 6, 2026
@michael-chou359 michael-chou359 changed the title feat: Added ui to support input params for task creation in dev environment feat: Added ui to support input params for task creation May 6, 2026
Comment on lines +181 to +200
{!taskID && !isDisabled && (
<div className="flex flex-col gap-1">
<button
type="button"
className="text-muted-foreground hover:text-foreground ml-4 flex items-center gap-1 text-sm transition-colors"
onClick={() => setIsTaskParamsOpen(v => !v)}
>
<span>{isTaskParamsOpen ? '▾' : '▸'}</span>
Task Parameters
</button>
{isTaskParamsOpen && (
<DataInput
prompt={taskParams}
setPrompt={setTaskParams}
isDisabled={isDisabled}
handleSendPrompt={handleSendPrompt}
codeMirrorViewRef={taskParamsViewRef}
/>
)}
</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing dev-only guard on Task Parameters UI

The PR description says "Also only available in dev environment," but neither the UI panel (line 181) nor the extraTaskParams parse logic (line 126) has a process.env.NODE_ENV === 'development' check. As-is, the Task Parameters accordion and its ability to inject arbitrary JSON into createTask are fully live in production, directly contradicting the stated design constraint.

Prompt To Fix With AI
This is a comment left during a code review.
Path: agentex-ui/components/primary-content/prompt-input.tsx
Line: 181-200

Comment:
**Missing dev-only guard on Task Parameters UI**

The PR description says "Also only available in dev environment," but neither the UI panel (line 181) nor the `extraTaskParams` parse logic (line 126) has a `process.env.NODE_ENV === 'development'` check. As-is, the Task Parameters accordion and its ability to inject arbitrary JSON into `createTask` are fully live in production, directly contradicting the stated design constraint.

How can I resolve this? If you propose a fix, please make it concise.

Fix in Cursor Fix in Claude Code Fix in Codex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants