Skip to content

feat(agent-dialog): require default folder for provider CLI agents - #543

Merged
pikann merged 1 commit into
masterfrom
feature/require-default-folder-for-provider-cli-agents
Oct 4, 2026
Merged

pikann merged 1 commit into
masterfrom
feature/require-default-folder-for-provider-cli-agents

Conversation

@pikann

@pikann pikann commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Provider CLI agents created without a default folder never start their conversation when assigned a task. The create-agent dialog now requires a default folder for provider CLI agents:

  • The Default folder field is marked required (*) and the "No default folder" option is hidden, so a folder must be picked or created.
  • The Create button stays disabled until both the default environment and the default folder are set.
  • DefaultFolderSelect gains an optional required prop (default false), so the agent detail page behaves as before.

Not included: server-side enforcement. A direct API call can still create a provider CLI agent without default_folder_id, and existing agents without a folder are unaffected.

Type of Change

  • Other

Checklist

  • The change is focused and scoped.
  • Related documentation is updated. (No docs affected.)
  • New structure or direction is explained clearly.
  • I avoided unnecessary detail or premature abstraction.

🤖 Generated with Claude Code

@pikann pikann changed the title feat(agent-dialog): require default folder selection and update folde… feat(agent-dialog): require default folder for provider CLI agents Oct 4, 2026

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No critical issues — two minor suggestions.

Reviewed changes

  • create-agent-dialog.tsx — provider_cli step2Valid now also requires defaultFolderId, and the Default folder field is marked * and passes required to the select.
  • environment-folder-select.tsx — DefaultFolderSelect gains an optional required prop (default false) that hides the "No default folder" item and skips the NO_FOLDER → "" mapping; mirrors the existing DefaultEnvironmentSelect.required.

ℹ️ Required-folder gate is UI-only

The dialog now blocks the broken case, but the server still accepts a provider_cli agent created without default_folder_id through any non-dialog client (direct API, MCP, older frontends), so the "conversation never starts" failure remains reachable outside this form. The PR body explicitly scopes server enforcement out — worth confirming whether a follow-up is planned, since the failure mode is what motivated the change.

Technical details
# Server-side enforcement for provider_cli default folder

## Affected sites
- `apps/web/src/components/projects/agents/create-agent-dialog.tsx:516` — UI gate added here
- server agent-create path — no equivalent requirement for `agentType == provider_cli` + missing `default_folder_id`

## Required outcome
- Decide whether provider_cli agents must reject creation without a default folder server-side (the dialog already surfaces `ApiErrorCode.AgentDefaultFolderInvalid`).

## Open questions for the human
- Is a server-side validation follow-up planned, or is dialog-only enforcement the intended long-term boundary?

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

<>
<Select
value={value || NO_FOLDER}
value={required ? value : value || NO_FOLDER}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

When required and no folder is picked yet, value is "", which matches no item — and unlike DefaultEnvironmentSelect (which passes a placeholder), this <SelectValue /> has none, so the trigger renders blank. This is reachable for a freshly created environment whose folders is null/empty. environments.picker.folderPlaceholder already exists in every locale.

Technical details
# Missing placeholder on required folder select

## Affected sites
- `apps/web/src/components/projects/environments/environment-folder-select.tsx:168` — `value={required ? value : value || NO_FOLDER}`
- `apps/web/src/components/projects/environments/environment-folder-select.tsx:198` — `<SelectValue />` lacks a `placeholder`
- `apps/web/src/components/projects/environments/environment-folder-select.tsx:96-102` — `DefaultEnvironmentSelect` sets one for its required case

## Required outcome
- The required folder trigger shows a prompt before a folder is chosen, consistent with the required environment select.

## Suggested approach (optional)
- `<SelectValue placeholder={required ? t("environments.picker.folderPlaceholder") : undefined} />`

@pikann
pikann merged commit 929053d into master Oct 4, 2026
2 checks passed
@pikann
pikann deleted the feature/require-default-folder-for-provider-cli-agents branch October 4, 2026 10:58
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.

1 participant