Skip to content

Support concurrent named sessions through send - #187

Draft
t-kalinowski wants to merge 18 commits into
mainfrom
feat/named-sessions
Draft

t-kalinowski wants to merge 18 commits into
mainfrom
feat/named-sessions

Conversation

@t-kalinowski

@t-kalinowski t-kalinowski commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Add an optional session argument so clients and agents can run independent Console sessions concurrently. New names start with their first code cell; ordinary calls default to default. Empty calls collect all active sessions and report names and statuses in text and structured output. Restarting a named session without code or nonempty input leaves it stopped until reuse; default recovery stays unchanged.

Internally, each session owns startup, requirements, worker generations, input, and output. The connection retains shared configuration and recording. Aggregate polls share response limits and a deadline and recover output after cancellation. Connection closure retires all sessions. Python clients, R tool discovery, documentation, and public regressions cover the new interface. Existing tests that observe only the default session now select it explicitly.

Warmup selects the default session when the discovered interface exposes session; hidden or older interfaces keep their supported arguments. The installed-wheel smoke check also selects the default session before checking readiness. The shutdown fixture associates each named worker with its Linux PID namespace before checking that all nine worker, relay, and child identities retire at connection closure. Startup-cancellation fixtures wait for response delivery before probing a long poll, with a native write gate exercising the ordering. Completion collectors retain [done] when a controlled evaluation returns its output and completion in separate replies, while preserving session selection.

Focused macOS validation passed 15 session, startup, cancellation, restart, native R, and writable-root cases (19 executions). The response-write gate reproduced the exact aggregate-poll failure before the fixture repair. The Linux writable-roots transcript was regenerated successfully through the repository runner on hosted Ubuntu, preserving its R/Python writes and sandbox assertions; the temporary capture step is removed. All 23 client self-tests passed. scripts/check passed for the fixture and collector repair; the final shared-deadline adjustment passed its owning regression. Formatting and whitespace checks passed. Full current-head CI remains pending.

Select session owners through send, create names with their first code cell,
and collect active sessions through an unqualified poll. Keep named workers
stopped after retirement until reused while preserving default recovery.

Scope runtime, requirements, output, and recording associations to each
session. Share aggregate response budgets and retain each delivery receipt
through cancellation and connection shutdown.
Apply the existing test-only DuckDB snapshot to direct and MXC SQL
scenarios. Assert the selected version before the long query so cold
caches cannot silently introduce the known Arrow cancellation limitation.
Preserve production defaults, interruption deadlines, and exact results.
Queue stdin while the replacement cell is held at its checkpoint, then
release it and collect the complete result. Preserve the exact output
and idle-state assertions without assuming one response completes the cell.
Keep native Windows scenarios on their selected session now that empty
sends collect all sessions. Assert the selected idle output and update
collector self-tests to require the exact default-session poll arguments.
Keep output deltas, terminal states and single-submission checks intact.
Keep the required completion marker when a control-and-cell response is
split across polls. Exercise the split with a gated native R startup cell
and select the same contract in related restart continuations.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant