Add session-scoped continuation lease workflow API#85722
Conversation
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Keep open: this is a useful-looking new plugin/session workflow primitive, but it should not merge as-is because the same-session contract still accepts a separate agent route, the test helper returns the wrong result discriminator, and the supplied proof does not exercise the production scheduler path. Canonical path: Close this PR as superseded by #80370. So I’m closing this here and keeping the remaining discussion on #80370. Review detailsBest possible solution: Close this PR as superseded by #80370. Do we have a high-confidence way to reproduce the issue? Yes for the patch defects: source inspection of the PR branch shows agentId is accepted independently of session context and createTestPluginApi returns enqueued while the type and implementation use scheduled. The feature itself is not a bug reproduction. Is this the best way to solve the issue? No as-is: the narrow same-session lease shape is plausible, but the safest solution is to derive routing from trusted session context only, align helper/docs with the public contract, and require production-path proof or review alongside the /goal PR. Security review: Security review needs attention: The diff has no dependency, workflow, or secret-handling changes, but the new same-session scheduling API needs a routing-boundary fix before merge.
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 9ede882f08eb. |
|
ClawSweeper applied the proposed close for this PR.
|
|
@clawsweeper this closure appears to have picked the wrong superseding target. Thanks. I think this was closed by automation against the wrong superseding target: #80370 is the diagnostics/skill-tool telemetry PR and does not add a session continuation lease API or This PR is intended as the narrow runtime/API scaffold for #85723:
I have left #85723 stacked on this branch so maintainers can review the runtime primitive separately from the user-facing |
|
@openclaw-barnacle @clawsweeper This PR is still required because it provides the narrow runtime/API primitive that #85723 depends on (same‑session continuation lease, no cross‑session routing, no fanout, no model‑selected session targeting). |
|
@clawsweeper re-review |
Summary
Why
Agents can already continue work when the model stays on target and the runtime path is lucky. The missing runtime primitive is a narrow, reviewable way for a feature to ask for one follow-up turn in the same trusted session, with host-owned routing and an explicit clear path.
This PR adds that primitive without adding a new autonomous product surface. A bundled plugin can ask the host to enqueue the next turn for the same trusted session, without introducing cross-session targeting, fanout, or model-selected routing.
This is intentionally narrower than #79925. It does not add silent wake modes, cross-session delegation, trusted insertion into sibling sessions, or host-wide fanout. It is also complementary to #85232: that PR recovers an already-queued stuck session; this API gives a plugin a narrow way to create one same-session follow-up turn in the first place.
Safety
session: ctx; the model does not provide a targetsessionKeyTests
Also verified as part of the stacked branch:
Real behavior proof
tmp/upstream-prs/openclaw-goalon branchgoal-command-minimal, commit1e24225457, with the scaffold commit325f4c1f27underneath.pnpm exec tsxcommand in the checkout that importscreateTestPluginApi()fromsrc/plugin-sdk/plugin-test-api.ts, then callsapi.session.workflow.requestSessionContinuationLease(...)andapi.session.workflow.clearSessionContinuationLease(...)withsessionKey: "agent:proof:session"andleaseKey: "active-goal"./goalPR includes a live command-handler proof for the user-facing flow.Follow-up
A stacked follow-up PR adds the user-facing
/goalcommand on top of this API: #85723.That PR is the concrete product proof for this runtime primitive: humans get lifecycle controls and lightweight observability, while the model only gets bounded same-session continuation through
goal_status.I am happy to keep the two PRs stacked for easier review or combine them if maintainers prefer one review thread.