Skip to content

Commit a345963

Browse files
saravmajesticclaude
andcommitted
chore(auth): tidy logout test and document gateway sign-out
- Factor the repeated `altimate.json` existence check in the logout test into a helper - Document `altimate providers logout altimate-backend` and TUI `/logout` in the provider docs Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 199ef93 commit a345963

2 files changed

Lines changed: 9 additions & 16 deletions

File tree

‎docs/docs/configure/providers.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ Managed LLM access with dynamic routing across Sonnet 4.6, Opus 4.6, GPT-5.4, GP
4343

4444
For pricing, security, and data handling details, see the [Altimate LLM Gateway guide](https://help.altimate.ai/datamates/user-guide/components/llm-gateway/).
4545

46+
To sign out, run `altimate providers logout altimate-backend` (or `/logout` in the TUI). This removes the saved key from `~/.altimate/altimate.json` and the auth store, so workspace requests stop until you sign in again.
47+
4648
!!! tip "Automatic model selection"
4749
When Altimate credentials are configured and no model is explicitly chosen, the Altimate LLM Gateway is selected automatically. You can override this by setting `model` in your config or by restricting the `provider` section to specific providers only.
4850

‎packages/opencode/test/cli/providers-logout.test.ts‎

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ describe("providers logout", () => {
116116
}),
117117
{ mode: 0o600 },
118118
)
119+
const altimateFileExists = () =>
120+
fs.stat(altimatePath).then(
121+
() => true,
122+
() => false,
123+
)
119124

120125
yield* Effect.promise(() => fs.mkdir(dataDir, { recursive: true }))
121126
yield* Effect.promise(() => fs.mkdir(path.dirname(altimatePath), { recursive: true }))
@@ -133,14 +138,7 @@ describe("providers logout", () => {
133138
})
134139
opencode.expectExit(logout, 0, "providers logout altimate-backend")
135140
expect(logout.stdout).toContain("Logout successful")
136-
expect(
137-
yield* Effect.promise(() =>
138-
fs.stat(altimatePath).then(
139-
() => true,
140-
() => false,
141-
),
142-
),
143-
).toBe(false)
141+
expect(yield* Effect.promise(() => altimateFileExists())).toBe(false)
144142
expect(JSON.parse(yield* Effect.promise(() => fs.readFile(authPath, "utf8")))).toEqual({ anthropic })
145143

146144
// Credentials saved only to altimate.json (TUI paste dialog) must still be removable.
@@ -150,14 +148,7 @@ describe("providers logout", () => {
150148
})
151149
opencode.expectExit(fileOnlyLogout, 0, "providers logout file-only altimate-backend")
152150
expect(fileOnlyLogout.stdout).toContain("Logout successful")
153-
expect(
154-
yield* Effect.promise(() =>
155-
fs.stat(altimatePath).then(
156-
() => true,
157-
() => false,
158-
),
159-
),
160-
).toBe(false)
151+
expect(yield* Effect.promise(() => altimateFileExists())).toBe(false)
161152
expect(JSON.parse(yield* Effect.promise(() => fs.readFile(authPath, "utf8")))).toEqual({ anthropic })
162153
}),
163154
120_000,

0 commit comments

Comments
 (0)