-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: [for cherry-picking] Login now creates a valid default project, ra #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a63bd22
da5520c
3eae3c6
0bdf0ff
382adee
c04931d
bff3199
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,9 +24,12 @@ export function registerApiCommands(program: Command): void { | |
| } | ||
|
|
||
| const baseUrl = config.projects[project]?.baseUrl ?? "https://wave.online"; | ||
| const url = path.startsWith("http") | ||
| ? path | ||
| : `${baseUrl}${path.startsWith("/") ? path : `/${path}`}`; | ||
| const base = new URL(baseUrl); | ||
| const requested = new URL(path, `${base.origin}/`); | ||
| if (requested.protocol !== "https:" || requested.origin !== base.origin) { | ||
| throw new Error("API requests must use the configured WAVE HTTPS host"); | ||
| } | ||
| const url = requested.toString(); | ||
|
Comment on lines
+27
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 API requests lose any path prefix configured for the WAVE host Request addresses are now rebuilt from only the host part of the configured address ( Mechanism and secondary effectPreviously the URL was Additionally, the hard Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| const headers: Record<string, string> = { | ||
| Authorization: `Bearer ${apiKey}`, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,7 +93,9 @@ export async function connectSSE( | |
|
|
||
| while (!controller.signal.aborted) { | ||
| const { done, value } = await reader.read(); | ||
| if (done) break; | ||
| if (done) { | ||
| throw new Error("SSE connection closed"); | ||
| } | ||
|
Comment on lines
+96
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Streaming commands never stop and repeatedly show a connection error when the server ends the stream normally A normally finished event stream is now turned into a failure ( Why the retry limit never stops the loopOn every successful connection A cleaner approach is to distinguish an intentional server-side end (call Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
94
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔍 SSE reader is never released on error/reconnect When the loop now throws on stream end (or on any parsing error), the Was this helpful? React with 👍 or 👎 to provide feedback. |
||
|
|
||
| buffer += decoder.decode(value, { stream: true }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| export interface DeviceAuthResponse { | ||
| device_code: string; | ||
| user_code: string; | ||
| verification_uri: string; | ||
| verification_uri_complete?: string; | ||
| expires_in: number; | ||
| interval: number; | ||
| } | ||
|
|
||
| export interface TokenResponse { | ||
| access_token: string; | ||
| token_type?: string; | ||
| expires_in?: number; | ||
| refresh_token?: string; | ||
| } | ||
|
|
||
| export interface WaveConfig { | ||
| version: string; | ||
| currentProject: string; | ||
| projects: Record<string, { | ||
| organizationId: string; | ||
| organizationName: string; | ||
| baseUrl?: string; | ||
| region?: string; | ||
| }>; | ||
| defaults: { outputFormat: OutputFormat; protocol?: string; color: "auto" | "on" | "off" }; | ||
| telemetry: { enabled: boolean; errorReporting: boolean }; | ||
| } | ||
|
|
||
| export type OutputFormat = "table" | "json" | "yaml"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changelog was not updated for these user-facing fixes
The repository contract requires the
Unreleasedsection ofCHANGELOG.mdto be updated for user-facing changes, but this PR changes login behaviour, API request handling and streaming reconnects without adding any entry.Impact: Users and maintainers get no record of these behaviour changes in the changelog.
Rule reference
AGENTS.mdstates: "Conventional Commit titles; updateCHANGELOG.md(Unreleased) for user-facing changes." TheUnreleasedsection inCHANGELOG.md:7is still empty.Was this helpful? React with 👍 or 👎 to provide feedback.