Skip to content

Commit ec73d9e

Browse files
authored
Merge branch 'main' into mason/show-pool-id-in-browsers-list
2 parents bbc9b8a + da1c511 commit ec73d9e

44 files changed

Lines changed: 2550 additions & 648 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cursor/commands/qa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ Once all deployments are complete, present the human with these invoke commands
230230
kernel invoke ts-basic get-page-title --payload '{"url": "https://www.google.com"}'
231231
kernel invoke ts-captcha-solver test-captcha-solver
232232
kernel invoke ts-stagehand teamsize-task --payload '{"company": "Kernel"}'
233-
kernel invoke ts-anthropic-cua cua-task --payload '{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}'
233+
kernel invoke ts-anthropic-cua cua-task --payload '{"query": "Go to http://magnitasks.com, Click the Tasks option in the left-side bar, and move the 5 items in the To Do and In Progress items to the Done section of the Kanban board. You are done successfully when the items are moved.", "record_replay": true}'
234234
kernel invoke ts-magnitude mag-url-extract --payload '{"url": "https://en.wikipedia.org/wiki/Special:Random"}'
235235
kernel invoke ts-openai-cua cua-task --payload '{"task": "Go to https://news.ycombinator.com and get the top 5 articles"}'
236236
kernel invoke ts-gemini-cua gemini-cua-task --payload '{"startingUrl": "https://www.magnitasks.com/", "instruction": "Click the Tasks option in the left-side bar, and move the 5 items in the To Do and In Progress items to the Done section of the Kanban board? You are done successfully when the items are moved."}'
@@ -240,7 +240,7 @@ kernel invoke ts-claude-agent-sdk agent-task --payload '{"task": "Go to https://
240240
kernel invoke python-basic get-page-title --payload '{"url": "https://www.google.com"}'
241241
kernel invoke python-captcha-solver test-captcha-solver
242242
kernel invoke python-bu bu-task --payload '{"task": "Compare the price of gpt-4o and DeepSeek-V3"}'
243-
kernel invoke python-anthropic-cua cua-task --payload '{"query": "Return the first url of a search result for NYC restaurant reviews Pete Wells"}'
243+
kernel invoke python-anthropic-cua cua-task --payload '{"query": "Go to http://magnitasks.com, Click the Tasks option in the left-side bar, and move the 5 items in the To Do and In Progress items to the Done section of the Kanban board. You are done successfully when the items are moved.", "record_replay": true}'
244244
kernel invoke python-openai-cua cua-task --payload '{"task": "Go to https://news.ycombinator.com and get the top 5 articles"}'
245245
kernel invoke python-openagi-cua openagi-default-task -p '{"instruction": "Navigate to https://agiopen.org and click the What is Computer Use? button"}'
246246
kernel invoke py-claude-agent-sdk agent-task --payload '{"task": "Go to https://news.ycombinator.com and get the top 3 stories"}'

.github/workflows/fix-ci.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Fix CI Failures
2+
3+
on:
4+
workflow_run:
5+
workflows: [Run tests for the CLI]
6+
types: [completed]
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
actions: read
12+
13+
jobs:
14+
attempt-fix:
15+
if: >-
16+
${{ github.event.workflow_run.conclusion == 'failure' &&
17+
github.event.workflow_run.event == 'pull_request' &&
18+
github.event.workflow_run.name != 'Fix CI Failures' }}
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Install Cursor CLI
27+
run: |
28+
curl https://cursor.com/install -fsS | bash
29+
echo "$HOME/.cursor/bin" >> $GITHUB_PATH
30+
31+
- name: Configure git identity
32+
run: |
33+
git config user.name "Cursor Agent"
34+
git config user.email "cursor-agent@onkernel.com"
35+
36+
- name: Setup Go
37+
uses: actions/setup-go@v5
38+
with:
39+
go-version-file: 'go.mod'
40+
41+
- name: Fix CI failure
42+
env:
43+
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
44+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
BRANCH_PREFIX: ci-fix
46+
run: |
47+
cursor-agent -p "You are operating in a GitHub Actions runner for the Kernel CLI repository.
48+
49+
The GitHub CLI is available as \`gh\` and authenticated via GH_TOKEN. Git is available. You have write access to repository contents and can comment on pull requests, but you must not create or edit PRs directly.
50+
51+
# Context
52+
- Repo: ${{ github.repository }}
53+
- Workflow Run ID: ${{ github.event.workflow_run.id }}
54+
- Workflow Run URL: ${{ github.event.workflow_run.html_url }}
55+
- Fix Branch Prefix: ci-fix
56+
57+
# Codebase Structure
58+
- cmd/ - CLI commands (main command implementations)
59+
- cmd/proxies/ - Proxy-related commands
60+
- cmd/mcp/ - MCP server commands
61+
- pkg/ - Supporting packages and templates
62+
- Makefile - Build and test targets (\`make test\` runs \`go vet\` and \`go test\`)
63+
64+
# Goal
65+
Implement an end-to-end CI fix flow: identify the failing PR, analyze the failure, make minimal targeted fixes, and propose changes back.
66+
67+
# Requirements
68+
1. Use \`gh run view ${{ github.event.workflow_run.id }} --log-failed\` to get failure logs
69+
2. Identify the PR associated with the failed workflow run
70+
3. Analyze the failure - common issues include:
71+
- Go compilation errors
72+
- Test failures (missing interface methods, type mismatches)
73+
- Mock/fake implementations missing new interface methods
74+
- Linting issues from \`go vet\`
75+
4. Make minimal, targeted edits consistent with the repo style
76+
5. Create/update a fix branch: ci-fix/<pr-head-branch>
77+
6. Push changes and post a PR comment with ONLY a compare link for quick PR creation
78+
- Format: Describe the fix, then provide ONLY a single PR creation link
79+
- Example format:
80+
\"🔧 CI Fix Available
81+
I've pushed a fix for the CI failure.
82+
83+
👉 Click here to create a PR with the fix\"
84+
- Do NOT include any git merge instructions or manual merge commands
85+
- Only include the compare link (e.g., https://github.com/.../compare/...)
86+
87+
# Style Guidelines
88+
- Go: Follow existing patterns, use testify for tests
89+
- Comments: Keep simple, no extra formatting
90+
- Interfaces: When adding methods to interfaces, update all implementations including test fakes
91+
92+
# Constraints
93+
- Do NOT create PRs directly - only post comments with compare links
94+
- Avoid duplicate comments - update existing bot comments
95+
- If no actionable fix is possible, make no changes and post no comment
96+
- PR comments must ONLY include the PR creation link, no manual merge instructions
97+
" --model opus-4.5 --force --output-format=text

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ Commands with JSON output support:
213213
- `--output json`, `-o json` - Output raw JSON object
214214
- _Note: When a pool is specified, omit other session configuration flags—pool settings determine profile, proxy, viewport, etc._
215215
- `kernel browsers delete <id>` - Delete a browser
216-
- `-y, --yes` - Skip confirmation prompt
217216
- `kernel browsers view <id>` - Get live view URL for a browser
218217
- `--output json`, `-o json` - Output JSON with liveViewUrl
219218
- `kernel browsers get <id>` - Get detailed browser session info
@@ -519,7 +518,7 @@ kernel browsers create --kiosk
519518
kernel browsers create --profile-name my-profile
520519

521520
# Delete a browser
522-
kernel browsers delete browser123 --yes
521+
kernel browsers delete browser123
523522

524523
# Get live view URL
525524
kernel browsers view browser123

cmd/app.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cmd
22

33
import (
4-
"encoding/json"
54
"fmt"
65
"strings"
76

@@ -107,12 +106,7 @@ func runAppList(cmd *cobra.Command, args []string) error {
107106
fmt.Println("[]")
108107
return nil
109108
}
110-
bs, err := json.MarshalIndent(apps.Items, "", " ")
111-
if err != nil {
112-
return err
113-
}
114-
fmt.Println(string(bs))
115-
return nil
109+
return util.PrintPrettyJSONSlice(apps.Items)
116110
}
117111

118112
if apps == nil || len(apps.Items) == 0 {
@@ -242,12 +236,7 @@ func runAppHistory(cmd *cobra.Command, args []string) error {
242236
fmt.Println("[]")
243237
return nil
244238
}
245-
bs, err := json.MarshalIndent(deployments.Items, "", " ")
246-
if err != nil {
247-
return err
248-
}
249-
fmt.Println(string(bs))
250-
return nil
239+
return util.PrintPrettyJSONSlice(deployments.Items)
251240
}
252241

253242
if deployments == nil || len(deployments.Items) == 0 {

cmd/auth.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ func runAuth(cmd *cobra.Command, args []string) error {
8888
} else {
8989
pterm.Info.Printf("API Key: %s\n", strings.Repeat("*", len(apiKey)))
9090
}
91-
pterm.Warning.Println("Consider running 'kernel login' to use OAuth authentication")
9291
return nil
9392
}
9493

cmd/browser_pools.go

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package cmd
22

33
import (
44
"context"
5-
"encoding/json"
65
"fmt"
76
"strings"
87

@@ -44,16 +43,11 @@ func (c BrowserPoolsCmd) List(ctx context.Context, in BrowserPoolsListInput) err
4443
}
4544

4645
if in.Output == "json" {
47-
if pools == nil {
46+
if pools == nil || len(*pools) == 0 {
4847
fmt.Println("[]")
4948
return nil
5049
}
51-
bs, err := json.MarshalIndent(*pools, "", " ")
52-
if err != nil {
53-
return err
54-
}
55-
fmt.Println(string(bs))
56-
return nil
50+
return util.PrintPrettyJSONSlice(*pools)
5751
}
5852

5953
if pools == nil || len(*pools) == 0 {
@@ -155,12 +149,7 @@ func (c BrowserPoolsCmd) Create(ctx context.Context, in BrowserPoolsCreateInput)
155149
}
156150

157151
if in.Output == "json" {
158-
bs, err := json.MarshalIndent(pool, "", " ")
159-
if err != nil {
160-
return err
161-
}
162-
fmt.Println(string(bs))
163-
return nil
152+
return util.PrintPrettyJSON(pool)
164153
}
165154

166155
if pool.Name != "" {
@@ -187,12 +176,7 @@ func (c BrowserPoolsCmd) Get(ctx context.Context, in BrowserPoolsGetInput) error
187176
}
188177

189178
if in.Output == "json" {
190-
bs, err := json.MarshalIndent(pool, "", " ")
191-
if err != nil {
192-
return err
193-
}
194-
fmt.Println(string(bs))
195-
return nil
179+
return util.PrintPrettyJSON(pool)
196180
}
197181

198182
cfg := pool.BrowserPoolConfig
@@ -301,12 +285,7 @@ func (c BrowserPoolsCmd) Update(ctx context.Context, in BrowserPoolsUpdateInput)
301285
}
302286

303287
if in.Output == "json" {
304-
bs, err := json.MarshalIndent(pool, "", " ")
305-
if err != nil {
306-
return err
307-
}
308-
fmt.Println(string(bs))
309-
return nil
288+
return util.PrintPrettyJSON(pool)
310289
}
311290

312291
if pool.Name != "" {
@@ -364,12 +343,7 @@ func (c BrowserPoolsCmd) Acquire(ctx context.Context, in BrowserPoolsAcquireInpu
364343
}
365344

366345
if in.Output == "json" {
367-
bs, err := json.MarshalIndent(resp, "", " ")
368-
if err != nil {
369-
return err
370-
}
371-
fmt.Println(string(bs))
372-
return nil
346+
return util.PrintPrettyJSON(resp)
373347
}
374348

375349
tableData := pterm.TableData{

0 commit comments

Comments
 (0)