-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Claude-like cli flags, auth fixes #10797
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
980681e
Claude-like cli flags, auth fixes
cte 8e65f76
Update apps/cli/src/commands/cli/run.ts
cte 80de137
Don't show onboarding if a provider is specified
cte 1f08401
Support a --workspace flag
cte d14e7e2
Add a --oneshot option
cte e41438f
Remove timeout
cte dc7579f
Fix evals
cte f913492
fix: pass currentMode to Header for dynamic mode display
roomote 0123d1e
fix: update release.sh to use new CLI syntax
roomote File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| import fs from "fs" | ||
| import path from "path" | ||
| import os from "os" | ||
|
|
||
| describe("run command --prompt-file option", () => { | ||
| let tempDir: string | ||
| let promptFilePath: string | ||
|
|
||
| beforeEach(() => { | ||
| tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "cli-test-")) | ||
| promptFilePath = path.join(tempDir, "prompt.md") | ||
| }) | ||
|
|
||
| afterEach(() => { | ||
| fs.rmSync(tempDir, { recursive: true, force: true }) | ||
| }) | ||
|
|
||
| it("should read prompt from file when --prompt-file is provided", () => { | ||
| const promptContent = `This is a test prompt with special characters: | ||
| - Quotes: "hello" and 'world' | ||
| - Backticks: \`code\` | ||
| - Newlines and tabs | ||
| - Unicode: 你好 🎉` | ||
|
|
||
| fs.writeFileSync(promptFilePath, promptContent) | ||
|
|
||
| // Verify the file was written correctly | ||
| const readContent = fs.readFileSync(promptFilePath, "utf-8") | ||
| expect(readContent).toBe(promptContent) | ||
| }) | ||
|
|
||
| it("should handle multi-line prompts correctly", () => { | ||
| const multiLinePrompt = `Line 1 | ||
| Line 2 | ||
| Line 3 | ||
|
|
||
| Empty line above | ||
| \tTabbed line | ||
| Indented line` | ||
|
|
||
| fs.writeFileSync(promptFilePath, multiLinePrompt) | ||
| const readContent = fs.readFileSync(promptFilePath, "utf-8") | ||
|
|
||
| expect(readContent).toBe(multiLinePrompt) | ||
| expect(readContent.split("\n")).toHaveLength(7) | ||
| }) | ||
|
|
||
| it("should handle very long prompts that would exceed ARG_MAX", () => { | ||
| // ARG_MAX is typically 128KB-2MB, so let's test with a 500KB prompt | ||
| const longPrompt = "x".repeat(500 * 1024) | ||
|
|
||
| fs.writeFileSync(promptFilePath, longPrompt) | ||
| const readContent = fs.readFileSync(promptFilePath, "utf-8") | ||
|
|
||
| expect(readContent.length).toBe(500 * 1024) | ||
| expect(readContent).toBe(longPrompt) | ||
| }) | ||
|
|
||
| it("should preserve shell-sensitive characters", () => { | ||
| const shellSensitivePrompt = ` | ||
| $HOME | ||
| $(echo dangerous) | ||
| \`rm -rf /\` | ||
| "quoted string" | ||
| 'single quoted' | ||
| $((1+1)) | ||
| && | ||
| || | ||
| ; | ||
| > /dev/null | ||
| < input.txt | ||
| | grep something | ||
| * | ||
| ? | ||
| [abc] | ||
| {a,b} | ||
| ~ | ||
| ! | ||
| #comment | ||
| %s | ||
| \n\t\r | ||
| ` | ||
|
|
||
| fs.writeFileSync(promptFilePath, shellSensitivePrompt) | ||
| const readContent = fs.readFileSync(promptFilePath, "utf-8") | ||
|
|
||
| // All shell-sensitive characters should be preserved exactly | ||
| expect(readContent).toBe(shellSensitivePrompt) | ||
| expect(readContent).toContain("$HOME") | ||
| expect(readContent).toContain("$(echo dangerous)") | ||
| expect(readContent).toContain("`rm -rf /`") | ||
| }) | ||
| }) |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Removed timeout safeguard can cause indefinite hangs
Medium Severity
The
runTaskmethod's 110-second timeout safeguard was removed. Previously, if notaskCompletedorerrorevent was received within the timeout, the promise would reject with a clear error. Without this, if the extension fails to emit these events (due to bugs, network issues, or crashes), the CLI in non-TUI mode will hang indefinitely waiting for a promise that never resolves. Users can still Ctrl+C to exit, but there's no automatic protection against silent hangs.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.
This is intentional. We need a better mechanism for hang detection.