fix(foreman): multi-repo spec reading and repo validation (#254) #272

Merged
charles merged 1 commit from fix/254-foreman-multi-repo into main 2026-04-22 20:58:20 +00:00
Owner

Closes #254

What

Three small gaps left in the multi-repo foreman feature — the schema migration, file endpoints, and session binding were already done; these are the remaining pieces:

Backend

handleForemanBreakdownPreview — was always reading the spec from the local filesystem via resolveAllowlistedFile. For any repo other than charles/claude-hooks (the service cwd) the file doesn't exist locally, so "Breakdown" would always return 404. Now uses the same local/remote split the other file handlers already have: cwd repo → local FS, any other repo → getRepoFileContent via the foreman token.

handleForemanChat — accepted any valid owner/name string as a repo without checking it against cfg.repos. Now returns 400 when a non-empty ctx.repos list is configured and the requested repo isn't in it.

UI

Chat panel — adds a thin Repo: <badge> bar above the transcript whenever the active session is bound to a repo, so it's always clear which repo a session targets without having to look at the sidebar chip.

Closes #254 ## What Three small gaps left in the multi-repo foreman feature — the schema migration, file endpoints, and session binding were already done; these are the remaining pieces: ### Backend **`handleForemanBreakdownPreview`** — was always reading the spec from the local filesystem via `resolveAllowlistedFile`. For any repo other than `charles/claude-hooks` (the service cwd) the file doesn't exist locally, so "Breakdown" would always return 404. Now uses the same local/remote split the other file handlers already have: cwd repo → local FS, any other repo → `getRepoFileContent` via the foreman token. **`handleForemanChat`** — accepted any valid `owner/name` string as a repo without checking it against `cfg.repos`. Now returns `400` when a non-empty `ctx.repos` list is configured and the requested repo isn't in it. ### UI **Chat panel** — adds a thin `Repo: <badge>` bar above the transcript whenever the active session is bound to a repo, so it's always clear which repo a session targets without having to look at the sidebar chip.
fix(foreman): multi-repo spec reading and repo validation (#254)
All checks were successful
qa / qa (pull_request) Successful in 4m5s
qa / dockerfile (pull_request) Successful in 8s
b03c9e9f98
- handleForemanBreakdownPreview: fetch spec from Forgejo API for
  non-cwd repos instead of always reading local FS (was 404 for
  every repo other than charles/claude-hooks)
- handleForemanChat: validate repo against cfg.repos and return
  400 when an unknown repo is supplied
- Planner chat panel: show a thin 'Repo:' badge above the
  transcript when the active session is bound to a repo
charles deleted branch fix/254-foreman-multi-repo 2026-04-22 20:58:20 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!272
No description provided.