From a6e5f93bbe7c8cfb6c5832edf1d5c55ba817e437 Mon Sep 17 00:00:00 2001 From: didericis Date: Sun, 7 Jun 2026 10:19:03 -0400 Subject: [PATCH] docs(prd): expand user-provider-plugins to cover Dockerfile convention and provisioning methods --- docs/prds/prd-new-user-provider-plugins.md | 117 ++++++++++++++++++--- 1 file changed, 100 insertions(+), 17 deletions(-) diff --git a/docs/prds/prd-new-user-provider-plugins.md b/docs/prds/prd-new-user-provider-plugins.md index 8f29224..589f8e4 100644 --- a/docs/prds/prd-new-user-provider-plugins.md +++ b/docs/prds/prd-new-user-provider-plugins.md @@ -12,10 +12,16 @@ again at launch. Users who want to run a different agent (Gemini, Aider, a custo local model wrapper) cannot add a provider without forking the package. This PRD opens the registry to user-defined plugins. A plugin placed at -`~/.bot-bottle/contrib//agent_provider.py` is discovered and loaded at launch -time. The manifest accepts any non-empty template string that names a built-in or -resolves to a user plugin at that path. No changes to the built-in providers or the -internal `bot_bottle/contrib/` layout. +`~/.bot-bottle/contrib//` is discovered and loaded at launch time. The manifest +accepts any non-empty template string that names a built-in or resolves to a user +plugin at that path. + +Alongside discovery, this PRD moves CA and git provisioning out of the Docker backend +and into the `AgentProvider` ABC as overridable methods. The current standalone +`provision/ca.py` and `provision/git.py` files in the Docker backend are deleted; +their logic becomes the default implementations on the ABC. This lets exotic provider +images (different base OS, different user, non-standard trust mechanism) override +provisioning freely without the abstraction fighting them. The preceding commit on this PR moves `codex_auth.py` from `bot_bottle/` into `bot_bottle/contrib/codex/` — a clean-up that fits naturally here since this PR @@ -32,33 +38,49 @@ be "cheap to add" — but "cheap" today still means a pull request against the b repo, not a drop-in file in the user's home directory. The filesystem layout is already the right shape; the discovery step is missing. +Beyond discovery, the Docker backend's `provision_ca` and `provision_git` functions +bake in Debian-specific commands (`update-ca-certificates`) and a hardcoded container +user (`node`). A user plugin that runs as a different user, or on a different base OS, +silently gets the wrong provisioning with no way to correct it short of forking. + ## Goals / Success Criteria 1. A user places `~/.bot-bottle/contrib//agent_provider.py` — a file that exports a class inheriting `AgentProvider` — sets `agent_provider.template: ` in a bottle's frontmatter, and launches a bottle using that provider with no changes to the bot-bottle source. -2. The manifest validator accepts any non-empty template string. Unknown templates that +2. The plugin directory may also contain a `Dockerfile` at + `~/.bot-bottle/contrib//Dockerfile`; the existing three-tier Dockerfile cascade + (per-bottle override → manifest `dockerfile:` field → provider default) uses this + path as the provider default for user plugins. +3. The manifest validator accepts any non-empty template string. Unknown templates that resolve to no user plugin still raise a clear error, but at launch (via `get_provider`) rather than at manifest-load time. -3. Built-in provider knobs (`auth_token` → claude only; `forward_host_credentials` → +4. Built-in provider knobs (`auth_token` → claude only; `forward_host_credentials` → codex only) are guarded to built-in template names. Bottles using a user provider may set neither knob. -4. `get_provider(template)` checks `~/.bot-bottle/contrib/