Skip to content

Add local file picker API (codex) - #2311

Merged
numnx merged 1 commit into
feature/CODUX-139-settings-mcp-and-custom-containerfrom
task/feature-codux-139-settings-mcp-and-custom-contai-t01-codex-mr91ffpb
Jul 6, 2026
Merged

Add local file picker API (codex)#2311
numnx merged 1 commit into
feature/CODUX-139-settings-mcp-and-custom-containerfrom
task/feature-codux-139-settings-mcp-and-custom-contai-t01-codex-mr91ffpb

Conversation

@numnx

@numnx numnx commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Add local file picker API

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 139 · Settings mcp and & custom container · Task: T01

Improve Settings so operators can configure HTTP MCP servers with clear guidance and choose a custom container setup script through a file-picker field.

📝 Full Task Prompt
## Objective
Add a backend and dashboard API contract for browsing local files so settings can select a custom container setup script without free-typing every path.

## Scope
- `src/server/local-directory-routes.ts`
- `src/contracts/app-types.ts` `LocalDirectoryBrowserResponse` or a new adjacent response type
- `dashboard/src/types.ts` and `dashboard/src/v2/types.ts` re-exported local browser types
- `dashboard/src/v2/lib/project-api.ts`
- `tests/backend/server/local-directory-routes.test.ts`

## Implementation Requirements
1. Extend the local browser route surface with a file-capable endpoint, preferably `GET /api/local-files`, reusing the same allowed-root resolution, home/cwd/configured-root policy, path expansion, realpath containment checks, and sanitized error behavior as `/api/local-directories`.
2. Return directory navigation metadata plus sorted `directories` and sorted `files`, where each file entry includes at least `name` and absolute `path`; do not include file contents.
3. Add a typed dashboard API helper such as `fetchLocalFiles(directoryPath?: string)` in `dashboard/src/v2/lib/project-api.ts` and shared response types in the existing dashboard type re-export path.
4. Add backend tests covering directory and file listing, alphabetical sorting, access denial outside allowed roots, sanitized errors for missing paths, and the existing `/api/local-directories` behavior remaining unchanged.
5. Update `docs/settings/configuration-and-storage.md` to mention that the settings UI can browse allowed local roots for setup script paths and that the endpoint lists names/paths only.

## Constraints
- Do not expose arbitrary filesystem access outside home, current working directory, or `CODE_UX_DIRECTORY_BROWSER_ROOTS`.
- Do not return file contents, file sizes that are not needed, secrets, or unsanitized rejected paths.
- Preserve the existing `/api/local-directories` response shape for project directory picking.
- Keep the route cross-platform; do not assume POSIX path separators or executable extensions.

## Verification
- Run `pnpm exec vitest run tests/backend/server/local-directory-routes.test.ts`.
- Run `pnpm run lint`.
- Success means `/api/local-files` returns selectable files under allowed roots, denied paths return sanitized errors, and existing directory-picker tests still pass.

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-06 09:48:48 UTC
Finished 2026-07-06 09:52:26 UTC
Duration 3m 38s

📊 Token Usage

Metric Value
Input tokens 98,768
Cached input tokens 585,728
Output tokens 7,771
Total tokens 692,267
Invocations 1
Tool calls 33
Active time 3m 14s

Included usage estimate (subscription/local login): $1.02

🌿 Branch Info

Base: feature/CODUX-139-settings-mcp-and-custom-container
Head: task/feature-codux-139-settings-mcp-and-custom-contai-t01-codex-mr91ffpb


🤖 Generated by Code UX

@numnx
numnx merged commit 24e607a into feature/CODUX-139-settings-mcp-and-custom-container Jul 6, 2026
4 checks passed
@numnx
numnx deleted the task/feature-codux-139-settings-mcp-and-custom-contai-t01-codex-mr91ffpb branch July 6, 2026 09:55
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