docs(agents): tighten provider boundary guidance

This commit is contained in:
Vincent Koc
2026-04-04 14:13:46 +09:00
parent 026ca40be9
commit e07d8fd20b
3 changed files with 42 additions and 0 deletions

View File

@@ -36,6 +36,21 @@ third-party plugins see.
matching `src/plugin-sdk/<id>.ts` facade.
- If core or core tests need a bundled plugin helper, export it from `api.ts`
first instead of letting them deep-import extension internals.
- For provider plugins, keep auth, onboarding, catalog selection, and
vendor-only product behavior local to the plugin. Do not move those into
core just because two providers look similar.
- Before adding a new provider-local `wrapStreamFn`, `buildReplayPolicy`,
`normalizeToolSchemas`, `inspectToolSchemas`, or compat patch helper, check
whether the same behavior already exists through `openclaw/plugin-sdk/*`.
Reuse shared family helpers first.
- If two bundled providers share the same replay policy shape, tool-schema
compat rewrite, payload patch, or stream-wrapper chain, stop copying the
logic. Extract one shared helper and migrate both call sites in the same
change.
- Prefer named provider-family helpers over repeating raw option bags. If a
provider needs OpenAI-style Anthropic tool payload compat, Gemini schema
cleanup, or an XAI compat patch, use a named shared helper instead of
inlining the policy knobs again.
## Expanding The Boundary