Summary
The web app currently has two different "Add Project" entry points with inconsistent behavior:
- Sidebar add project supports both GitHub URLs and local paths
- Settings → Projects → Add Project only submits
{ path }
This means adding a GitHub repository URL from the Settings page fails or is handled incorrectly, even though the API and the sidebar both support URL-based project registration.
Evidence
1) Docs/README say a project can be added via GitHub URL or local path
In README.md:
Register a project by clicking + next to "Project" in the chat sidebar - enter a GitHub URL or local path.
2) The server API explicitly supports either url or path
In packages/server/src/routes/schemas/codebase.schemas.ts:
/** POST /api/codebases request body. Exactly one of url or path must be provided. */
and:
{
url?: string,
path?: string,
allowEnvKeys?: boolean
}
3) The server route branches correctly on url vs path
In packages/server/src/routes/api.ts:
const result = body.url
? await cloneRepository(body.url, body.allowEnvKeys)
: await registerRepository(body.path ?? '', body.allowEnvKeys);
4) Sidebar add-project UI supports both
In packages/web/src/components/layout/Sidebar.tsx:
const isLocalPath =
trimmed.startsWith('/') || trimmed.startsWith('~') || /^[A-Za-z]:[/\\]/.test(trimmed);
const input = isLocalPath ? { path: trimmed } : { url: trimmed };
Its input placeholder also says:
placeholder="GitHub URL or local path"
5) Settings page does not
In packages/web/src/routes/SettingsPage.tsx:
mutationFn: ({ path, allowEnvKeys }: { path: string; allowEnvKeys?: boolean }) =>
addCodebase({ path, allowEnvKeys })
and:
addMutation.mutate({ path: addPath.trim(), allowEnvKeys: allowEnvKeys || undefined });
The placeholder is also path-only:
placeholder="/path/to/repository"
Why this matters
From a user perspective, both entry points are "Add Project" UI, so they should behave consistently.
Right now:
- pasting a GitHub URL into the sidebar works
- pasting the same GitHub URL into Settings can fail because it is sent as
path
This creates a confusing UX and makes the Settings page appear broken for valid inputs supported elsewhere in the app.
Suggested Fix
Use the same input detection logic in SettingsPage.tsx as in the sidebar:
- detect local paths (
/, ~, Windows drive prefix)
- otherwise send
{ url: trimmed }
Also update the Settings placeholder text to match actual supported behavior, e.g.:
placeholder="GitHub URL or local path"
Expected Behavior
Both "Add Project" entry points in the web UI should accept the same valid inputs and submit them the same way.
Summary
The web app currently has two different "Add Project" entry points with inconsistent behavior:
{ path }This means adding a GitHub repository URL from the Settings page fails or is handled incorrectly, even though the API and the sidebar both support URL-based project registration.
Evidence
1) Docs/README say a project can be added via GitHub URL or local path
In
README.md:2) The server API explicitly supports either
urlorpathIn
packages/server/src/routes/schemas/codebase.schemas.ts:/** POST /api/codebases request body. Exactly one of url or path must be provided. */and:
3) The server route branches correctly on
urlvspathIn
packages/server/src/routes/api.ts:4) Sidebar add-project UI supports both
In
packages/web/src/components/layout/Sidebar.tsx:Its input placeholder also says:
5) Settings page does not
In
packages/web/src/routes/SettingsPage.tsx:and:
The placeholder is also path-only:
Why this matters
From a user perspective, both entry points are "Add Project" UI, so they should behave consistently.
Right now:
pathThis creates a confusing UX and makes the Settings page appear broken for valid inputs supported elsewhere in the app.
Suggested Fix
Use the same input detection logic in
SettingsPage.tsxas in the sidebar:/,~, Windows drive prefix){ url: trimmed }Also update the Settings placeholder text to match actual supported behavior, e.g.:
Expected Behavior
Both "Add Project" entry points in the web UI should accept the same valid inputs and submit them the same way.