Repository navigation
feat(rc-gateway): the sessions-at-rest family gets a gateway path - #74
Merged
Merged
Conversation
The daemon has served POST /sessions/{archive,unarchive,delete} all along and
DaemonClient has had the three calls, but DaemonPool forwarded none of them and
the gateway exposed no route, so the viewer could not reach any of it. Two
missing layers, not a missing capability.
Archive and delete are deliberately separate routes rather than one route with
a flag. Archiving is reversible and deleting is not, so delete carries a
`confirm: true` the others do not, checked server-side rather than trusted from
the client: a stray call cannot destroy a transcript, and the guard holds for
clients that never draw a dialog. The refusal happens before anything reaches
the daemon, which the zero-call assertion in the test pins down -- a guard that
runs after the destructive call is not a guard.
The daemon's per-id outcome (removed / notFound / errors) is passed through
untouched and a daemon refusal answers 502, never a 200 with an empty body:
flattening a partial failure into a bare success is the bug class this family
is about.
workspaceCwd is a pool-routing argument only and is never forwarded. The
client's second parameter is a daemon clientId, so passing the cwd there would
be read as an identity rather than a target. Signatures mirror DaemonClient's
SHIPPED two parameters with cwd appended, which is what keeps a plain
DaemonClient structurally satisfying SessionDaemon; the three-parameter
clientIdOrOptions overload exists in SDK source but has not reached dist, so
coding against it does not compile.
OWNER-scoped like /rc/sessions, since these reach every transcript in a
workspace rather than one session.
Verified: rc-gateway suite 236 files, 2931 passed, 2 skipped, no failures;
tsc --noEmit and eslint src clean; 9 new tests in sessionRest.test.ts.
Closes InfiniteInsight/Qwen-Code-Remote#111
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes InfiniteInsight/Qwen-Code-Remote#111
The daemon has served
POST /sessions/{archive,unarchive,delete}all along andDaemonClienthas had the three calls, butDaemonPoolforwarded none of themand the gateway exposed no route, so the viewer could not reach any of it. Two
missing layers, not a missing capability.
Why it is shaped this way
Archiving is reversible and deleting is not, so delete carries a
confirm: truethe others do not. The check is server-side rather thantrusted from the client, so a stray call cannot destroy a transcript and the
guard holds for clients that never draw a dialog.
assertion in the test pins that down; a guard that runs after the destructive
call is not a guard.
removed/notFound/errors) and a daemon refusal answers 502, never a 200 with anempty body. Flattening a partial failure into a bare success is the bug class
this family is about.
workspaceCwdis a pool-routing argument only and is never forwarded.The client's second parameter is a daemon
clientId, so passing the cwdthere would be read as an identity rather than a target. Signatures mirror
DaemonClient's shipped two parameters with cwd appended, which is whatkeeps a plain
DaemonClientstructurally satisfyingSessionDaemon. Thethree-parameter
clientIdOrOptionsoverload exists in SDK source but has notreached
dist/, so coding against it does not compile./rc/sessions, since these reach every transcript in aworkspace rather than one session. Audit records the ids as
target, neverthe cwd.
Files
packages/rc-gateway/src/routes/sessionRest.ts(new)packages/rc-gateway/src/routes/sessionRest.test.ts(new, 9 tests)packages/rc-gateway/src/daemonPool.ts— three pool forwards + the namedDaemonDeleteSessionsResult(the SDK declares that shape inline and neverexports a name for it)
packages/rc-gateway/src/auditLog.ts— six action names in the closed unionand its runtime list
packages/rc-gateway/src/server.ts— three mountsVerification, read off this run
tsc --noEmitclean,eslint srccleanzero daemon calls, and a truthy-but-not-
trueconfirm treated as no confirmNot in this PR
The viewer rail row actions. This PR is the gateway half; the rail is the
follow-up that makes it reachable by hand rather than by curl.