Repository navigation
feat(agents): add Freebuff launch and sidebar status support #23567
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 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
9b22ec2
feat(agents): add Freebuff terminal agent support
nwparker 7ada239
fix(agents): publish Freebuff sidebar lifecycle status
nwparker e13c1a5
fix(agents): reset Freebuff status at a new session boundary
nwparker fa87dce
test(terminal): baseline existing Freebuff transcript replay differences
nwparker 8bc9370
test(terminal): pin exact Freebuff replay baseline checkpoints
nwparker 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
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
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,94 @@ | ||
| import { describe, expect, it, vi } from 'vitest' | ||
|
|
||
| const { | ||
| callMock, | ||
| runtimeClientConstructorMock, | ||
| serveOrcaAppMock, | ||
| getDefaultUserDataPathMock, | ||
| addEnvironmentFromPairingCodeMock, | ||
| listEnvironmentsMock, | ||
| spawnMock | ||
| } = vi.hoisted(() => ({ | ||
| callMock: vi.fn(), | ||
| runtimeClientConstructorMock: vi.fn(), | ||
| serveOrcaAppMock: vi.fn(), | ||
| getDefaultUserDataPathMock: vi.fn(() => '/tmp/orca-user-data'), | ||
| addEnvironmentFromPairingCodeMock: vi.fn(), | ||
| listEnvironmentsMock: vi.fn(), | ||
| spawnMock: vi.fn() | ||
| })) | ||
|
|
||
| vi.mock('./runtime-client', async () => { | ||
| const { createRuntimeClientModuleMock } = await import('./index-test-harness.js') | ||
| return createRuntimeClientModuleMock({ | ||
| callMock, | ||
| runtimeClientConstructorMock, | ||
| serveOrcaAppMock, | ||
| getDefaultUserDataPathMock | ||
| }) | ||
| }) | ||
|
|
||
| vi.mock('./runtime/environments', () => ({ | ||
| addEnvironmentFromPairingCode: addEnvironmentFromPairingCodeMock, | ||
| listEnvironments: listEnvironmentsMock, | ||
| removeEnvironment: vi.fn(), | ||
| resolveEnvironment: vi.fn() | ||
| })) | ||
|
|
||
| vi.mock('child_process', async () => { | ||
| const { createChildProcessModuleMock } = await import('./index-test-harness.js') | ||
| return createChildProcessModuleMock(spawnMock) | ||
| }) | ||
|
|
||
| import { main } from './index' | ||
| import { buildWorktree, okFixture, queueFixtures, worktreeListFixture } from './test-fixtures' | ||
| import { useWorktreeAwarenessEnvironment } from './index-test-harness' | ||
|
|
||
| describe('Freebuff worktree creation', () => { | ||
| useWorktreeAwarenessEnvironment({ | ||
| callMock, | ||
| serveOrcaAppMock, | ||
| getDefaultUserDataPathMock, | ||
| addEnvironmentFromPairingCodeMock, | ||
| listEnvironmentsMock, | ||
| spawnMock | ||
| }) | ||
|
|
||
| it('passes Freebuff and its prompt to the runtime without activating the worktree', async () => { | ||
| queueFixtures( | ||
| callMock, | ||
| worktreeListFixture([buildWorktree('/tmp/repo', 'main', 'abc', 'repo-1')]), | ||
| okFixture('req_create', { | ||
| worktree: buildWorktree('/tmp/repo/freebuff-task', 'freebuff-task', 'abc', 'repo-1') | ||
| }) | ||
| ) | ||
| vi.spyOn(console, 'log').mockImplementation(() => {}) | ||
|
|
||
| await main( | ||
| [ | ||
| 'worktree', | ||
| 'create', | ||
| '--repo', | ||
| 'id:repo-1', | ||
| '--name', | ||
| 'freebuff-task', | ||
| '--agent', | ||
| 'freebuff', | ||
| '--prompt', | ||
| 'Review this workspace', | ||
| '--json' | ||
| ], | ||
| '/tmp/repo' | ||
| ) | ||
|
|
||
| expect(callMock).toHaveBeenNthCalledWith( | ||
| 2, | ||
| 'worktree.create', | ||
| expect.objectContaining({ | ||
| startupAgent: 'freebuff', | ||
| startupPrompt: 'Review this workspace', | ||
| activate: false | ||
| }) | ||
| ) | ||
| }) | ||
| }) |
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,38 @@ | ||
| import { describe, expect, it } from 'vitest' | ||
| import { | ||
| getTuiAgentDetectionProbeCommands, | ||
| KNOWN_TUI_AGENT_DETECTION_COMMANDS, | ||
| resolveDetectedTuiAgentIds | ||
| } from './tui-agent-detection-commands' | ||
|
|
||
| describe('Freebuff detection', () => { | ||
| it.each(['darwin', 'linux', 'win32', 'wsl'] as const)( | ||
| 'detects Freebuff independently of Codebuff on %s', | ||
| (runtime) => { | ||
| expect( | ||
| getTuiAgentDetectionProbeCommands(KNOWN_TUI_AGENT_DETECTION_COMMANDS, runtime) | ||
| ).toContain('freebuff') | ||
| expect( | ||
| resolveDetectedTuiAgentIds( | ||
| KNOWN_TUI_AGENT_DETECTION_COMMANDS, | ||
| new Set(['freebuff']), | ||
| runtime | ||
| ) | ||
| ).toEqual(['freebuff']) | ||
| expect( | ||
| resolveDetectedTuiAgentIds( | ||
| KNOWN_TUI_AGENT_DETECTION_COMMANDS, | ||
| new Set(['codebuff']), | ||
| runtime | ||
| ) | ||
| ).toEqual(['codebuff']) | ||
| expect( | ||
| resolveDetectedTuiAgentIds( | ||
| KNOWN_TUI_AGENT_DETECTION_COMMANDS, | ||
| new Set(['freebuff', 'codebuff']), | ||
| runtime | ||
| ) | ||
| ).toEqual(expect.arrayContaining(['freebuff', 'codebuff'])) | ||
| } | ||
| ) | ||
| }) |
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,31 @@ | ||
| import { afterEach, describe, expect, it, vi } from 'vitest' | ||
|
|
||
| const { getActiveMultiplexerMock } = vi.hoisted(() => ({ | ||
| getActiveMultiplexerMock: vi.fn() | ||
| })) | ||
|
|
||
| vi.mock('../ssh/ssh-target-registry', () => ({ | ||
| getActiveMultiplexer: getActiveMultiplexerMock | ||
| })) | ||
|
|
||
| import { detectRemoteAgents } from './agent-detection' | ||
|
|
||
| afterEach(() => vi.resetAllMocks()) | ||
|
|
||
| describe('Freebuff SSH detection', () => { | ||
| it('asks the execution host to detect Freebuff separately from Codebuff', async () => { | ||
| const request = vi.fn().mockResolvedValue({ agents: ['freebuff'] }) | ||
| getActiveMultiplexerMock.mockReturnValue({ isDisposed: () => false, request }) | ||
|
|
||
| await expect(detectRemoteAgents({ connectionId: 'ssh-freebuff' })).resolves.toEqual([ | ||
| 'freebuff' | ||
| ]) | ||
| expect(getActiveMultiplexerMock).toHaveBeenCalledWith('ssh-freebuff') | ||
| expect(request).toHaveBeenCalledWith('preflight.detectAgents', { | ||
| commands: expect.arrayContaining([ | ||
| { id: 'freebuff', cmd: 'freebuff' }, | ||
| { id: 'codebuff', cmd: 'codebuff' } | ||
| ]) | ||
| }) | ||
| }) | ||
| }) |
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,9 @@ | ||
| { | ||
| "capturedAt": "2026-09-28T07:56:49.813Z", | ||
| "platform": "darwin", | ||
| "command": ["freebuff", "--cwd", "/tmp/orca-freebuff-folder-workspace"], | ||
| "cols": 120, | ||
| "rows": 40, | ||
| "note": "Freebuff 0.1.2 authenticated free plan; choice, answer, tool, interruption, tool error", | ||
| "exitCode": 0 | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
| { | ||
| "capturedAt": "2026-09-28T07:20:19.119Z", | ||
| "platform": "darwin", | ||
| "command": ["freebuff", "--cwd", "/tmp/orca-freebuff-verify"], | ||
| "cols": 100, | ||
| "rows": 32, | ||
| "note": "Freebuff npm 0.1.2, unauthenticated, macOS arm64; no model inference", | ||
| "exitCode": 0 | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
| { | ||
| "capturedAt": "2026-09-28T08:15:15.356Z", | ||
| "platform": "darwin", | ||
| "command": ["freebuff", "--cwd", "/tmp/orca-freebuff-trust"], | ||
| "cols": 120, | ||
| "rows": 40, | ||
| "note": "Freebuff 0.1.2 authenticated, declined repository agent files; waiting for first message", | ||
| "exitCode": 0 | ||
| } |
Large diffs are not rendered by default.
Oops, something went wrong.
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,9 @@ | ||
| { | ||
| "capturedAt": "2026-09-28T08:09:19.020Z", | ||
| "platform": "darwin", | ||
| "command": ["freebuff", "--cwd", "/tmp/orca-freebuff-trust"], | ||
| "cols": 120, | ||
| "rows": 40, | ||
| "note": "Freebuff 0.1.2; harmless repository agent file trust prompt, not accepted", | ||
| "exitCode": 0 | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.