Skip to content

feat: per-project default agent (settings.projectAgents) - #23

Merged
rubenperezrial merged 4 commits into
mainfrom
feat/project-agent-defaults
Sep 26, 2026
Merged

rubenperezrial merged 4 commits into
mainfrom
feat/project-agent-defaults

Conversation

@rubenperezrial

Copy link
Copy Markdown

What

  • settings.json gains projectAgents (worktree → agent): a per-project default agent that wins over the global currentAgent for that project.
  • resolveProjectAgent / fetchCurrentAgent / getStoredAgent are now project-aware.
  • Picking an agent while a project is active stores the choice for that project only (selectAgentForCurrentProject); without an active project it keeps writing the global setting.
  • Tests cover precedence, fallback, project scoping and persistence; PRODUCT.md documents it.

Intended use: primigenum → boss by default while other projects keep their global agent.

Verification

  • bun run check green (lint + build + 1847 tests).

Notes

Stacked on #22 (branch base = feat/local-pdf-extraction), so the diff shows only this commit. When #22 merges and its branch is deleted, GitHub retargets this PR to main automatically.

Video messages and video/* documents were rejected as unsupported, so a
walkthrough clip sent to the bot was dropped. They are now downloaded
(<=20 MB, Telegram Bot API limit), saved to the agent upload dir
(LOCAL_VISION_UPLOAD_DIR, same as photos), and the saved path is appended
to the prompt so the agent can process the original file locally (e.g.
extract frames with ffmpeg). Oversize videos get a clear file_too_large
reply before downloading; media groups with videos stay unsupported.
A project can now have a default agent (settings.json `projectAgents`, keyed by worktree) that wins over the global currentAgent for that project.

- resolveProjectAgent / fetchCurrentAgent / getStoredAgent are project-aware
- picking an agent while a project is active stores it for the project only (selectAgentForCurrentProject); without an active project it keeps writing the global setting
- tests cover precedence, fallback, scoping and persistence; PRODUCT.md updated
@rubenperezrial
rubenperezrial deleted the branch main September 26, 2026 18:18
@rubenperezrial
rubenperezrial changed the base branch from feat/local-pdf-extraction to main September 26, 2026 18:20
@rubenperezrial
rubenperezrial merged commit 9d194a5 into main Sep 26, 2026
1 check passed
@rubenperezrial
rubenperezrial deleted the feat/project-agent-defaults branch September 26, 2026 18:48
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