Replies: 3 comments
|
Strong +1 on making the headless boundary explicit. A few contract details would make this safer for CI and service orchestration:
Disclosure: I maintain SandBase Harness, which exposes a similar persistent-session + resumable-event API and a DSH MCP bridge. The most important lesson there was treating the machine-output channel and resume semantics as a public API from day one. Happy to review the eventual flag/output schema. |
|
This would materially improve embedding. I checked the proposed wiring against rc.8 (
So a get-or-create A few adjacent protocol gates seem important:
The current rc.8 runner already has a good interval boundary: it records I wrote up a proposed public contract and sixteen-case acceptance matrix here: |
|
I'v integrated DeepSeek Harness into my project DataAI Portal as an option to OpenClaw for China mainland users, you can have a review in my artical "Testing DeepSeek Harness in deep" in Chinese. You can chat to analysis data with JupyterLab R/Python kernel backends and switch as your will between the kernels. You can watch what AI is doing backend by opening a console in JupyterLab, here is the Python console's output, the codes and results. |

Uh oh!
There was an error while loading. Please reload this page.
Summary
dsh --profile headlessis the standard one-shot entry point, but it currently lacks three capabilities that are table stakes for embedding DSH as a programmatic backend (scripts, CI, service orchestration):--session-id <id>— get-or-create session resume. Every headless invocation today creates a freshrandomUUID()session, so conversation state is lost across processes / restarts.--model <provider>/<model>— per-run model override. The model is hard-coded in the profile (agent-default-model); callers must generate a temporary--patchfile as a workaround.--json— structured stdout (text/sessionId/provider/model/toolSummary/durationMs/stopReason/error), mirroringopenclaw agent --json, instead of plain text that callers must regex-parse.Motivation
openclaw agent --session-key/--session-id/--json, Claude Code, and Codex all support session resume, per-run model selection, and structured output. Headless has none of these, which forces embedders (e.g. our DataAI Portal, which drivesdshas an execution backend) to forkdsh-headlessor write fragile regex / zstd-parsing workarounds.The underlying capabilities already exist —
AgentRegistry.resume({ resumeSessionId }),session-persistence-jsonl, and the runner'sagent.session.eventsstream — so these flags are really just the headless entry point wiring them up.Proposed changes (all in
packages/bundle/headless/)src/startup.ts— parse--session-id,--model,--jsonsrc/index.ts(runner) — get-or-create resume branch + model override + structured result summarycordis.patch.yml— wire the new fields from the startup provider into the runner configSemantics
--session-id <id>— resume the persisted session with this id when it exists, otherwise create it (get-or-create). Backed by the existingAgentRegistry.resume()+session-persistence-jsonl.--model <provider>/<model>— overrideagent-default-modelfor this run. Omitting the provider keeps the current one.--json— single-line JSON object on stdout; exit-code semantics unchanged (0 on completed, non-zero otherwise);stopReason === "error"carries anerrorobject.Status
--session-idhas been implemented in a local fork and verified end-to-end (cross-process resume of pure conversation history — not long-term memory — confirmed via the persisted session JSONL).--modeland--jsonare designed but not yet implemented upstream.Posting here first to align on scope and API naming before writing the final code. Happy to open a PR once there's agreement — detailed per-flag design notes are available if useful.
All reactions