[plugin sdk] Add generic SDK seam followups#74483
[plugin sdk] Add generic SDK seam followups#74483100yenadmin wants to merge 94 commits intoopenclaw:mainfrom
Conversation
|
Codex review: found issues before merge. What this changes: The PR branch adds additive Plugin SDK and Gateway surfaces for host runtime reads, derived tool paths, attachment hints, Control UI input-suppression descriptors, tagged scheduled-turn cleanup, session-entry slot projection, session actions, QA boundary cleanup, generated Swift clients, and contract tests. Maintainer follow-up before merge: Maintainer next action: keep this as a normal active draft PR, have the author fix the stale tagged-unscheduling guard on the PR branch, resolve/rebase after #73384, and then rerun the expected SDK/protocol validation; this is not a separate ClawSweeper repair lane candidate. Security review: Security review cleared: The diff touches CI workflow defaults, Gateway scope classification, generated clients, and plugin SDK surfaces, but I found no concrete new supply-chain, secret, dependency, action-ref, or downloaded-code execution concern. Review findings:
Review detailsBest possible solution: Keep the draft available for maintainer and author review, fix the stale-registry guard in tagged unscheduling, resolve and rebase after #73384, preserve the channel/tool-agnostic design questions from discussion, then rerun the focused SDK, protocol, generated-client, lint, type, and changed-lane validation before marking it ready. Do we have a high-confidence way to reproduce the issue? Yes for the review finding: retain a plugin API object from a retired registry, load a replacement registry with tagged scheduled turns for the same plugin/session, then call unscheduleSessionTurnsByTag on the stale API object. The PR head reaches cron.list and cron.remove without the live-plugin guard; this is not an end-user reproduction because the item is a draft SDK PR. Is this the best way to solve the issue? No, this is not mergeable as-is. The additive SDK direction fits the plugin boundary, but tagged unscheduling needs the same live side-effect guard used by the sibling workflow APIs, and the branch should be reviewed again after #73384 lands or is otherwise resolved. Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4429ee7d2e7f. |
|
+1 on the seam set. The descriptor + registry shape — Two "what stays channel/tool-agnostic" questions I'd want to look at once this rebases onto fresh
Neither is a blocker for this draft — flagging now so they don't get lost when this goes ready-for-review. |
d68e78c to
b02f0b8
Compare
389c621 to
492275f
Compare
492275f to
bc2d5ad
Compare
Adds host runtime reads, derived tool paths, channel attachment hints, input-suppression descriptors, scheduler tag cleanup, session-entry slot projection, and channel helper exports on top of the workflow seams.
bc2d5ad to
09253bf
Compare
|
Closing this consolidated stack in favor of individual hook/seam PRs. The code has been through hardening, but the combined PR became too large and brittle against fast-moving upstream main plugin sprint leading to messy additional debugging. Splitting it back into focused fresh-main PRs should reduce reviewer load, isolate CI failures, and make each generic SDK seam independently mergeable even if main shifts. |
|
Closing this consolidated stack in favor of individual hook/seam PRs. The code has been through hardening, but the combined PR became too large and brittle against fast-moving upstream main. Splitting it into focused fresh-main PRs should reduce reviewer load, isolate CI failures, and make each generic SDK seam independently mergeable. Replacement slices opened so far:
The advanced workflow fixture slice should be filed after these seams land on main; opening it now from fresh main would fail before the public seams exist, while stacking or duplicating those seams would recreate the brittle consolidated PR this split is replacing. Docs remain split in #74853; foundation remains merged #72287. |
Draft status
This is a draft preview PR for the generic SDK seam follow-up branch. It is intentionally draft while #73384 is still open, because the branch is prepared on top of the #73384 head so maintainers can inspect the intended follow-up delta without reopening the closed dirty #73526. After #73384 lands, this branch should be rebased onto fresh
main, revalidated, and then marked ready as a standalone PR.Docs split update: the large host-hook recipe docs inherited from #73384 were moved to #74853, so this PR remains a single code/test follow-up commit (~2,027 additions / 26 deletions across 41 files) without the docs page in its stack diff.
This PR is generic plugin SDK work. It does not add product-specific prompts, command behavior, product UI, or channel-specific workflow logic. The goal is to close the remaining SDK gaps for non-trivial workflow plugins: deployment approvers, budget guards, SLA watchers, review assistants, channel-native workflow plugins, scheduled reminders, sub-agent observability plugins, and session projection consumers.
Feature / LOC Breakdown
Current intended delta against #73384:
_host.runtimerun context, subagent parent/settle tracking,derivedPathsforapply_patch, parser registry.suppressHostInputWhiledescriptor field carried through registry, Gateway schema, and generated clients.unscheduleSessionTurnsByTag, canonical payload ordering, cleanup tests.SessionEntryslots, reserved-key guard, unset/projector-failure coverage.openclaw/plugin-sdk/qa-channeldependency in favor of public@openclaw/qa-channelre-exports.Relationship To #73384
#73384 adds the workflow affordances: session actions, attachments, scheduling, finalize retry, and fixtures. The large recipes/docs page is split to #74853. This draft adds the smaller SDK seams needed by plugins that compose those affordances without reaching into core internals.
What Future Plugins Can Do
Added SDK / Protocol Surface
getHostRunContext("_host.runtime")for read-only host runtime snapshots.derivedPaths?: string[]onbefore_tool_callevents for host-derived tool param facts.PluginSessionAttachmentParams.captionFormatandchannelHintsfor typed channel delivery intent.PluginControlUiDescriptor.suppressHostInputWhilecarried through registry and Gateway descriptors.PluginSessionTurnScheduleParams.tagandpayloadExtras.unscheduleSessionTurnsByTag(...)for deterministic plugin-owned scheduled turn cleanup.PluginSessionExtensionRegistration.sessionEntrySlotKeyandsessionEntrySlotSchemafor safe slot projection.Hardening Included
suppressHostInputWhilecould be dropped before Gateway clients.@openclaw/qa-channelAPI.Review Guide
Suggested review order:
src/plugins/host-runtime-namespace.ts,src/plugins/host-hook-runtime.ts,src/infra/agent-events.ts.src/agents/apply-patch-paths.ts,src/plugins/host-tool-param-parsers.ts,src/agents/pi-tools.before-tool-call.ts.src/plugins/host-hook-workflow.ts,src/plugins/host-hooks.ts,src/plugins/api-builder.ts,src/plugins/types.ts.src/plugins/session-entry-slot-keys.ts,src/plugins/host-hook-state.ts, registry validation.src/gateway/protocol/schema/plugins.ts, generated Swift models.src/plugins/contracts/host-runtime-reads.contract.test.ts,src/plugins/contracts/sdk-seam-followups.contract.test.ts, focused unit tests.Validation
Local validation from the cleaned follow-up branch before the latest #73384 restack:
Current pushed head after the latest restack:
09253bf6919743e65d5709cf31abf2bd9166cda5. Treat GitHub CI on that head as the exact-head signal until #73384 lands and this draft is rebased ontomain.Maintainer Notes
mainafter [plugin sdk] Consolidate workflow seams and fixtures #73384 lands.Issue / RFC Linkage