feat(config): multi-developer support via automation.json + companion /whoami#76
feat(config): multi-developer support via automation.json + companion /whoami#76marcoaperez wants to merge 2 commits into
Conversation
|
Thank you, @marcoaperez — this is a good direction, and the implementation is clean (optional I want to hold it briefly rather than merge piecemeal. This PR introduces a per-developer Rather than land two overlapping port-config mechanisms, we're going to design one canonical companion config that both your Marking |
|
The base companion config this PR's override layer was deferred to design against has landed in acc480e. It ships the How it slots in (see
One divergence to settle: this PR's title puts |
… /whoami Lets multiple developers work against the same FMS-hosted solution, each from their own machine with their own companion server, without hardcoding `If Get(AccountName) = "..."` branches into the FM script. - automation.json.example documents an optional `users` section, keyed by FileMaker account name, holding each developer's repo path and companion host/port. - companion_server.py gets GET /whoami?account=<name>, which resolves that block from automation.json. Returns 400 with a clear message when the account isn't configured (or automation.json has no `users` section at all) — callers fall back to the existing folder-picker/cached-global behavior. - filemaker/README.md documents the setup. This PR covers the config + companion side only, which is fully testable outside of a live FileMaker instance (see test plan). Wiring this into `Get agentic-fm path` / `Explode XML` on the FM script side is a natural follow-up once the direction lands — happy to iterate on that once this part is reviewed. The existing folder-picker flow is untouched and keeps working exactly as before; `users` is entirely optional. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Per maintainer review: acc480e landed agent/config/companion.json as the canonical companion config and already ships the `users[<account>]` schema in companion.json.example, so this PR's override layer builds on that settled base instead of introducing a second, overlapping port-config mechanism in automation.json. - Reverted the `users` block I'd added to automation.json.example — no longer needed, the schema already lives in companion.json.example. - companion_server.py: replaced the `_load_automation_config()` helper I'd added — it collided with an existing, unrelated function of the same name already in the file (a real duplicate-definition bug, worth fixing regardless of this PR) — with `_load_companion_users()`, a sibling of the existing `_load_companion_config()` that reads the same companion.json file's `users` block instead of its `companion` block. `/whoami` now resolves through it. - agent/docs/COMPANION_SERVER.md: added a "Multi-developer override" section documenting the `users[<account>]` config shape, where it sits in the client-reach precedence chain (above `advertise_host`+`port`, below `COMPANION_URL`), and — per review — makes explicit that it is client-reach-only and never routes plug-in detection (`/health` carries no account; the detection cache is process-global; one plug-in per companion regardless of which account asks). - filemaker/README.md: "Multi-developer setup" now points at that doc section instead of duplicating the config example against the wrong file. Verified end-to-end against a live companion with a companion.json `users` block: known account resolves correctly, unknown account and missing `account` param both 400 with a clear message, and /health (plugin block) is unaffected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
ead5966 to
accaf7e
Compare
Lets multiple developers work against the same FMS-hosted solution, each from their own machine with their own companion server, without hardcoding
If Get(AccountName) = "..."branches into the FM script.This follows up on #30, which was a design-only writeup closed without comment — this time with working, testable code instead of just a proposal doc.
What this adds
automation.json.exampledocuments an optionaluserssection, keyed by FileMaker account name (Get(AccountName)), holding each developer's repo path and companion host/port.companion_server.pygetsGET /whoami?account=<name>, which resolves that block fromautomation.json. Returns400with a clear message when the account isn't configured (orautomation.jsonhas nouserssection at all) — callers fall back to the existing folder-picker/cached-global behavior.filemaker/README.mddocuments the setup under a new "Multi-developer setup" section.Scope
This PR covers the config + companion side only, which is fully testable outside of a live FileMaker instance (see test plan below). Wiring this into
Get agentic-fm path/Explode XMLon the FM script side — so it calls/whoamiinstead of relying solely on the folder-picker dialog — is a natural follow-up once this direction lands. Happy to iterate on that once this part is reviewed. The existing folder-picker flow is untouched and keeps working exactly as before;usersis entirely optional and backward-compatible.Test plan
accountquery param returns 400userssection inautomation.jsonat all → same 400 path, no crash