PRD: User-defined agent provider plugins #190

Merged
didericis merged 9 commits from prd-0052-user-provider-plugins into main 2026-06-07 11:51:51 -04:00
Collaborator

Summary

Opens the agent provider registry to user-defined plugins. A file at ~/.bot-bottle/contrib/<name>/agent_provider.py is discovered and loaded at launch — no bot-bottle source edits required.

Also moves codex_auth.py into contrib/codex/ as a clean-up that fits naturally here (both clarify that contrib/ is the per-provider home).

PRD: 98b0ddf2a5/docs/prds/0053-user-provider-plugins.md

## Summary Opens the agent provider registry to user-defined plugins. A file at `~/.bot-bottle/contrib/<name>/agent_provider.py` is discovered and loaded at launch — no bot-bottle source edits required. Also moves `codex_auth.py` into `contrib/codex/` as a clean-up that fits naturally here (both clarify that `contrib/` is the per-provider home). **PRD:** https://gitea.dideric.is/didericis/bot-bottle/src/commit/98b0ddf2a56c837b5d7d46e675a99f2564bc2c5a/docs/prds/0053-user-provider-plugins.md
didericis force-pushed prd-0052-user-provider-plugins from 29a1fda712 to 88a001160e 2026-06-04 14:14:32 -04:00 Compare
didericis force-pushed prd-0052-user-provider-plugins from b48856d76d to 030af02ac1 2026-06-04 20:29:41 -04:00 Compare
didericis force-pushed prd-0052-user-provider-plugins from 030af02ac1 to 35cbee52ed 2026-06-06 10:48:39 -04:00 Compare
didericis-claude changed title from PRD 0052: User-defined agent provider plugins to PRD 0053: User-defined agent provider plugins 2026-06-06 12:29:30 -04:00
didericis force-pushed prd-0052-user-provider-plugins from 98b0ddf2a5 to ee327d4dc2 2026-06-06 12:30:26 -04:00 Compare
didericis force-pushed prd-0052-user-provider-plugins from ee327d4dc2 to 0d4d930b29 2026-06-06 16:06:12 -04:00 Compare
didericis-claude changed title from PRD 0053: User-defined agent provider plugins to PRD: User-defined agent provider plugins 2026-06-06 22:10:42 -04:00
didericis added 8 commits 2026-06-07 11:39:01 -04:00
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
codex_auth.py was moved into contrib/codex/ but still used `.log`/
`.util` relative imports that resolved to the parent bot_bottle
package before the move — update to `...log` / `...util`.

_read_winsize() called sys.stdin.fileno() outside the OSError guard;
pytest's redirected stdin raises UnsupportedOperation (an OSError
subclass) there, breaking test_returns_first_tty_size. Move fileno()
inside the try block so any non-TTY stream is skipped cleanly.
Renames docs/prds/0052-user-provider-plugins.md to 0053-user-provider-plugins.md
and updates the heading inside the file. 0052 is now reserved for the egress
DLP addon.
- Add _load_user_plugin: loads AgentProvider subclass from
  ~/.bot-bottle/contrib/<name>/agent_provider.py; get_provider()
  checks there first before falling back to built-ins
- Add Dockerfile cascade to docker prepare: per-bottle override →
  manifest dockerfile → user plugin Dockerfile → provider default
- Move provision_ca and provision_git from backend-specific
  provision/ modules to AgentProvider ABC as overridable defaults;
  delete docker/provision/ca.py, docker/provision/git.py,
  smolmachines/provision/ca.py, smolmachines/provision/git.py
- Add git_gate_insteadof_host/scheme properties to BottlePlan base;
  SmolmachinesBottlePlan overrides them to return agent_git_gate_host
  and "http" so provision_git works correctly on both backends
- Move SIGKILL retry from smolmachines provision/ca.py into
  SmolmachinesBottle.exec via _exec_raw helper — all exec calls
  on smolmachines now transparently retry once on exit 137
- Relax manifest_agent template validation to allow user-defined
  template names; keep auth_token/forward_host_credentials guards
  for built-in-only features
- Update tests: rewrite test_docker_provision_git_user and
  test_smolmachines_provision to call provider methods directly;
  add TestSmolmachinesBottleExec for SIGKILL retry coverage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(lint): resolve pyright and pylint issues in provider/backend changes
lint / lint (push) Successful in 1m31s
prd-check / no-prd-new-on-main (pull_request) Failing after 21s
test / unit (pull_request) Successful in 28s
test / integration (pull_request) Successful in 43s
bba24d87f7
- Remove unused Bottle import from docker/backend.py (pyright)
- Suppress wrong-import-position on circular-import-avoiding
  deferred imports in backend/__init__.py (pylint C0413)
- Add encoding="utf-8" to read_text() in smolmachines provision
  test (pylint W1514)
- Suppress consider-using-with on TemporaryDirectory setUp pattern
  in both provision test files (pylint R1732)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
didericis force-pushed prd-0052-user-provider-plugins from ef0f3109b7 to bba24d87f7 2026-06-07 11:39:01 -04:00 Compare
didericis added 1 commit 2026-06-07 11:43:49 -04:00
chore(ci): remove prd-check workflow
test / unit (pull_request) Successful in 28s
test / integration (pull_request) Successful in 42s
lint / lint (push) Successful in 1m42s
prd-number / assign-numbers (push) Successful in 23s
test / unit (push) Successful in 35s
test / integration (push) Successful in 52s
Update Quality Badges / update-badges (push) Successful in 1m40s
0d5c2f1a2e
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
didericis merged commit 0d5c2f1a2e into main 2026-06-07 11:51:51 -04:00
didericis deleted branch prd-0052-user-provider-plugins 2026-06-07 11:51:51 -04:00
Sign in to join this conversation.