-
Notifications
You must be signed in to change notification settings - Fork 21
feat: bump supercode-cli version to 0.1.89 and improve error handling for usage limits: #231
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
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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -113,7 +113,18 @@ export class ServerProxyService { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!res.ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const text = await res.text() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (text.includes("Insufficient Funds") || text.includes("Credit usage at configured limit")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error("Cloud AI is warming up. Please try again in a moment.") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| content: "You've used your limits. Resets in 24hrs.", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| finishReason: "stop" as FinishReason, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| usage: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inputTokens: 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| inputTokenDetails: { noCacheTokens: 0, cacheReadTokens: 0, cacheWriteTokens: 0 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| outputTokens: 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| outputTokenDetails: { textTokens: 0, reasoningTokens: 0 }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| totalTokens: 0, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| toolCalls: [], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+116
to
+127
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. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Emit the synthetic response through
Proposed fix+ const message = "You've used your limits. Resets in 24hrs."
+ onChunk?.(message)
return {
- content: "You've used your limits. Resets in 24hrs.",
+ content: message,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error(text || "AI proxy request failed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -508,7 +519,9 @@ export class ServerProxyService { | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!res.ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const text = await res.text() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (text.includes("Insufficient Funds") || text.includes("Credit usage at configured limit")) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error("Cloud AI is warming up. Please try again in a moment.") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| object: { message: "You've used your limits. Resets in 24hrs." }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+522
to
+524
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. 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
rg -n -C4 '\bgenerateObject\s*\(' apps/supercode-cli/serverRepository: yashdev9274/supercli Length of output: 5365 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== file outline =="
ast-grep outline apps/supercode-cli/server/src/cli/ai/server-proxy-service.ts --view compact || true
echo "== relevant implementation =="
sed -n '460,535p' apps/supercode-cli/server/src/cli/ai/server-proxy-service.ts
echo "== calls to generateObject or use of returned object =="
rg -n -C3 'generateObject|\.object|serverProxy|ServerProxyService|new .*Service' apps/supercode-cli/server/src || true
echo "== package dependencies mentioning schema/generation =="
fd -a 'package.json' apps/supercode-cli/server | xargs -r cat | rg -n '"(ai|`@ai-sdk`|generateObject|zod)"|(`@types`)?zod' || trueRepository: yashdev9274/supercli Length of output: 35438 🌐 Web query:
💡 Result: The Vercel AI SDK's Citations:
Handle the credit-limit sentinel in the generator contract.
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| throw new Error(text || "AI proxy generate-object request failed") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Preserve usage from earlier tool-call rounds.
sendMessage()replaces its usage accumulator with this zeroed object. If the credit-limit response follows successful tool calls, the finaltotalTokensbecomes0, causingappendProxyUsage()to skip recording the earlier usage.🤖 Prompt for AI Agents