Repository navigation
fix(cli): stop auth from leasing or demanding a session through a remote config - #4879
Conversation
A command that cannot take a session runs on no remote connection. The CLI already derived that for reading the active connection (callstack#4839), but the leased-session guard, the remote-auth check, and the materialization check kept their own rules. Two bugs followed for `auth`: - `auth status --remote-config <profile>` started a local daemon, leased a device on it, and saved the profile as the active connection. - With a profile that names a lease provider, `auth status --remote-config` failed with REMOTE_SESSION_REQUIRED, and `auth` rejects `--session`. All four checks now read one predicate. The explicit lists keep only the commands that differ for another reason: `connection status` sends no request, and the connection-lifecycle commands materialize the connection themselves. The leased-sessions help and the remote-proxy, device-clouds, and commands docs now limit the session requirement to commands that take a session, and the leased-session test covers `web doctor`. Closes callstack#4850 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the fix. At 18ec3c8 the change looks ready, and the 2 checks are green with none failing. There are no conflicts. Not blocking, and fine to take or leave: Not verified here: the tests were not run and the fix was not reverted, so the regression check is reasoned from the base code path. The built CLI before/after run from the PR body was not repeated. The commands without Nothing from review stands in the way of merge. |
|
Note 🤖 Drafted by Claude Opus 5.5. Reviewed by @samanyudas and posted on their behalf. Filed #4887 for the On the points you could not verify, this is what I observed locally at
The CI workflows on this PR are still waiting for approval ( |
…pported commands (#4957) auth stopped running on remote connections in #4879 and already stripped every remote-config profile field in finalizeParsedArgs, making it the only session-less command still listing remoteConfig. Drop remoteConfig from auth.supportedFlags so every session-less command rejects it, and guard resolveCliOptions so --remote-config files are not read before unsupported-flag validation rejects the command. Closes #4887
Summary
A command that takes no session should run on no remote connection. #4839 applied that rule when the CLI reads the active connection. The leased-session guard, the remote-auth check, and the materialization check in
src/cli.tskept their own rules, andauthbroke in two ways:auth status --remote-config <profile>started a local daemon, leased a device, and saved the profile as the active connection.REMOTE_SESSION_REQUIRED, butauthrejects--session.All four checks now read one predicate,
isFlagSupportedForCommand('session', command). The help and three user docs now limit the session requirement to commands that take a session.Closes #4850. Scope expansion: the two
authfixes.Before / after
Built CLI, fresh state directory:
auth status --remote-config generic.json: base writesdaemon.jsonandremote-connections/default.json. Head writes nothing.auth status --remote-config leased.json: base fails withREMOTE_SESSION_REQUIRED. Head succeeds.snapshot --remote-config leased.json:REMOTE_SESSION_REQUIREDat both.auth login --remote-config, from code reading only: head no longer sends the profile's tenant, run, and daemon URL as device-auth hints.Validation
pnpm check:affected --run --head 18ec3c8b6: all checks passed except 2 untouched unit tests that hit the 5 s timeout and pass alone. Base6b4e4c1a1times out the same way on this loaded host. CI owns full unit.check:command-docs,check:doc-prose, andcheck:doc-linkspass.Reviewed with sol-loop: 2 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.