feat(plugin-sdk): re-export StatusSummary, SessionStatus, and HeartbeatStatus from command-status#77184
feat(plugin-sdk): re-export StatusSummary, SessionStatus, and HeartbeatStatus from command-status#77184lonexreb wants to merge 2 commits intoopenclaw:mainfrom
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: not applicable. this is a public SDK API expansion rather than a runtime bug. Source inspection on current main confirms the canonical status types exist and the requested command-status subpath does not export them yet. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the additive export with docs, changelog, API hash, and focused type coverage once the contributor supplies real OpenClaw/plugin output showing the new import works and maintainers accept the public status payload contract. Do we have a high-confidence way to reproduce the issue? Not applicable: this is a public SDK API expansion rather than a runtime bug. Source inspection on current main confirms the canonical status types exist and the requested command-status subpath does not export them yet. Is this the best way to solve the issue? Yes, conditionally: adding a type-only re-export to the existing What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 5fae1c32b5f8. |
6c25e3a to
1e9ff48
Compare
|
Fixed |
b1d7284 to
ddc5e2b
Compare
…atStatus from command-status (openclaw#76759) Plugins that consume gateway status RPCs or format /status output had no canonical type to import from openclaw/plugin-sdk and silently drifted from the host shape (lossless-claw#516 audit hit the wrong shape on every field). Re-export the three status payload types from the existing command-status entrypoint so binding against the host shape is one import instead of a copy-paste. Additive only. ModelCatalogEntry already exposed via plugin-sdk/agent-runtime. Tests: command-status.types.test.ts asserts the types are importable and assignable from a sample StatusSummary literal. API baseline regenerated (docs/.generated/plugin-sdk-api-baseline.sha256).
…t type test
CI check-test-types flagged an overlap mismatch on the StatusSummary['tasks']
shape — the inner TaskRegistrySummary requires { active, terminal, failures,
byStatus, byRuntime } and the test's { total, byScope } literal does not
overlap with that.
The point of this test is type-portability of the OUTER StatusSummary
re-export, not the host-internal nested types (which are locked by their own
tests in src/tasks/* and src/status/*). Cast through unknown for both
host-internal nested fields so the test asserts the public surface without
binding to host-internal shape.
ddc5e2b to
cfcfe62
Compare
Summary
Adds three additive type re-exports to the existing
openclaw/plugin-sdk/command-statusentrypoint so plugins consuming gateway status RPCs (or formatting/statusoutput) can bind against the canonical host shape:StatusSummary(top-level/statuspayload)SessionStatus(per-session row insidesummary.sessions.recent[]/summary.sessions.byAgent[].recent[])HeartbeatStatus(per-agent heartbeat status)ModelCatalogEntryis already exposed viaopenclaw/plugin-sdk/agent-runtime(re-exported fromagents/model-catalog.js) — kept as-is.Why
From the issue: an external plugin (
lossless-claw#516) navigatedsessions.byAgent[].entries[].usage.{promptTokens, totalTokens, input}againstStatusSummary— but the actual shape issessions.byAgent[].recent[]keyed bykey. The plugin'spickFirstNumberwould have returnednullon every field. Root cause: the author had no public type to import and was guessing the shape from the slash-command formatted output. Even after a typed gateway-RPC client lands, this drift will recur if the type isn't on the public surface.Changes
src/plugin-sdk/command-status.ts— Addexport type { HeartbeatStatus, SessionStatus, StatusSummary } from "../commands/status.types.js";with a comment pointing at the issue.src/plugin-sdk/command-status.types.test.ts— Regression test that imports each type and assigns from a sample literal so a future rename of the host type breaks here loudly.CHANGELOG.md—Unreleased > Changesentry.docs/.generated/plugin-sdk-api-baseline.sha256— Regenerated viapnpm plugin-sdk:api:gen;pnpm plugin-sdk:api:checkis green.Per
src/plugin-sdk/CLAUDE.md: additive, backwards-compatible, narrow. Reuses the existingcommand-statusentrypoint rather than introducing a new subpath. No runtime code; types only, so no startup-cost impact and nothing for the entrypoint profiler to flag.Test plan
pnpm test src/plugin-sdk/command-status.types.test.ts— 1/1 passpnpm plugin-sdk:api:gen— regenerated baselinepnpm plugin-sdk:api:check—OK docs/.generated/plugin-sdk-api-baseline.sha256pnpm exec oxfmt --checkon touched files — cleanRefs #76759.
Real behavior proof