Skip to content

add console, simulate, and agent dev commands#810

Merged
theomonnom merged 30 commits into
theo/console-webrtcfrom
theo/console-v2
May 11, 2026
Merged

add console, simulate, and agent dev commands#810
theomonnom merged 30 commits into
theo/console-webrtcfrom
theo/console-v2

Conversation

@theomonnom
Copy link
Copy Markdown
Member

No description provided.

@theomonnom theomonnom requested review from davidzhao and rektdeckard and removed request for davidzhao April 2, 2026 21:56
@theomonnom theomonnom force-pushed the theo/console-webrtc branch from b977661 to 734ede1 Compare April 2, 2026 22:50
- Add friendly error when no agent project is detected (start/dev/console)
- Print detected language and directory to stderr for start/dev/console
- Deduplicate console detection logic to use shared detectProject()
- Add nil guard in BytesToSamples for empty data
- Detect project root from entrypoint directory when --entrypoint is set
- Better entrypoint-not-found error showing checked paths
- Print detected language and directory to stderr for start/dev/console
- Render CLI errors in red at the call site
- Add maxMessageSize check to IPC WriteProto
@theomonnom theomonnom force-pushed the theo/console-v2 branch 9 times, most recently from a63b57e to 23148aa Compare April 3, 2026 00:16
Copy link
Copy Markdown
Member

@rektdeckard rektdeckard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for expediency, and I am in fact able to build and test (mostly) successfully against agents on theo/1.6.0 branch -- but there are some rough edges particularly around console project/entrypoint detection, text mode, and ergonomics that need some attention. I have not had success testing simulations, as I assume there is still outstanding backend work for that?

Comment thread cmd/lk/console.go
Action: runConsole,
}

func runConsole(ctx context.Context, cmd *cli.Command) error {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm seeing weird behavior when switching between audio and text modes in the console:

  • In text mode, messages are printed out-of-order (agent responses appearing before user)
  • Switching to text mode mid-call does not seem to work; responses continue to arrive in audio modality and text responses don't get printed

Comment thread cmd/lk/agent_run.go Outdated
Comment on lines +40 to +54
&cli.StringFlag{
Name: "url",
Usage: "LiveKit server `URL`",
Sources: cli.EnvVars("LIVEKIT_URL"),
},
&cli.StringFlag{
Name: "api-key",
Usage: "LiveKit API `KEY`",
Sources: cli.EnvVars("LIVEKIT_API_KEY"),
},
&cli.StringFlag{
Name: "api-secret",
Usage: "LiveKit API `SECRET`",
Sources: cli.EnvVars("LIVEKIT_API_SECRET"),
},
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These flags are already available globally; no need to redefine or even declare them on this command. But FYI, the precedence of resolution is:

  1. project specified in livekit.toml (actually this is probably too high, should probably be after flags but separate issue)
  2. explicit flags (--api-key, --api-secret, --url)
  3. explicit project (--project)
  4. environment variables
  5. default project

Comment thread README.md Outdated
make install
```

### Building with console support
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's maybe comment this out until we feel the feature is stable

Comment thread Formula/lk.rb Outdated
# This formula is meant for a custom Homebrew tap (e.g. livekit/homebrew-livekit).
# It installs a prebuilt binary with console support (PortAudio + WebRTC AEC).
# Usage: brew install livekit/livekit/lk
class Lk < Formula
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we are unable to distribute prebuilt binaries through homebrew's core package repository?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah homebrew has to build it from source.. and sign it with apple distribution keys

@rektdeckard
Copy link
Copy Markdown
Member

@claude review

CLI architecture:
- Non-interactive CI mode auto-detected (no TTY or CI env var)
- Shared lifecycle functions in simulate.go (no bubbletea dependency)
- simulate_ci.go: sequential runner with ::group:: output for GHA

TUI improvements:
- Detail view: unified scrollable content (instructions, transcript, logs)
- Log filtering by room name prefix (latest retry only)
- Compact chat transcript rendering
- Removed filter tabs, simplified matrix rain
- Mouse capture removed (text selection works)
- Summary unavailable message, summarizing spinner

Agent subprocess:
- Debug logging enabled, room-indexed log storage
- Per-room log filtering by prefix with latest-room tracking

Bug fix:
- Send CodeEntrypoint in ConfirmSourceUpload so the generator
  analyzes the correct file instead of the entire workspace
- Remove --url, --api-key, --api-secret flags from agent run commands
  (already available as global flags)
- Fix console text mode: suppress UserInputTranscribed events in text
  mode to prevent duplicate/out-of-order user messages
- Clear partial transcript when switching to text mode mid-call
@theomonnom
Copy link
Copy Markdown
Member Author

For the text mode issue, I'll handle that in a separate PR. This requires some protocol changes inside our new RemoteSession

…anges

- All agent subprocess commands (start, dev, console, simulate) require
  -tags console to build. Without the tag, they don't appear in lk agent.
- Revert .github/workflows/release.yaml and banner to main
- Remove .goreleaser.yaml (not on main)
- Move noAgentError to agent.go (non-tagged)
- Add init() registration for simulate command
@theomonnom theomonnom merged commit 1e7fa57 into theo/console-webrtc May 11, 2026
1 check passed
@theomonnom theomonnom deleted the theo/console-v2 branch May 11, 2026 05:41
theomonnom added a commit that referenced this pull request May 11, 2026
…audio (#810)  (#809)

* add vendored WebRTC APM and PortAudio native sources

* add console, simulate, and agent dev commands (#810)

* add console, simulate, agent dev commands with TUI and protobuf IPC

* improve agent detection error messages and consistency

- Add friendly error when no agent project is detected (start/dev/console)
- Print detected language and directory to stderr for start/dev/console
- Deduplicate console detection logic to use shared detectProject()
- Add nil guard in BytesToSamples for empty data

* improve error messages, entrypoint detection, and IPC safety

- Detect project root from entrypoint directory when --entrypoint is set
- Better entrypoint-not-found error showing checked paths
- Print detected language and directory to stderr for start/dev/console
- Render CLI errors in red at the call site
- Add maxMessageSize check to IPC WriteProto

* add console build docs and PortAudio submodule check

* add blank line after user/agent messages in console TUI

* remove duplicate -lc++ linker flags, cgo handles C++ linking automatically

* fix console TUI rendering, add startup spinner and handoff support

* remove local replace directives, use published server-sdk-go

Switch to the server-sdk-go branch that exports CreateSourceTarball,
MultipartUpload, and AgentSimulationClient. Fix spinnerFrames reference
across build tags.

* update server-sdk-go to include complete AgentSimulationClient

* update server-sdk-go to merged main with SimulationAdmin grant

* Fix agent watcher exitCh race on restart

* Remove default num-simulations, let server decide

* Show 'Generating scenarios' without count when num-simulations not specified

* Improve agent simulate TUI setup and log display

* Read NumSimulations from server response

* Use larger circle icon (⏺) in TUI

* Integrate save scenario overlay, show labels in job list, fix selected row highlight

* Softer yellow, use ⏺ for pending icons

* Pad selected row to max label width for consistent highlight

* Remove q to quit, only ctrl+c exits

* CI mode, TUI improvements, log filtering, and entrypoint fix

CLI architecture:
- Non-interactive CI mode auto-detected (no TTY or CI env var)
- Shared lifecycle functions in simulate.go (no bubbletea dependency)
- simulate_ci.go: sequential runner with ::group:: output for GHA

TUI improvements:
- Detail view: unified scrollable content (instructions, transcript, logs)
- Log filtering by room name prefix (latest retry only)
- Compact chat transcript rendering
- Removed filter tabs, simplified matrix rain
- Mouse capture removed (text selection works)
- Summary unavailable message, summarizing spinner

Agent subprocess:
- Debug logging enabled, room-indexed log storage
- Per-room log filtering by prefix with latest-room tracking

Bug fix:
- Send CodeEntrypoint in ConfirmSourceUpload so the generator
  analyzes the correct file instead of the entire workspace

* Use positional arg for entrypoint instead of --entrypoint flag

* Address PR review: remove redundant flags, fix console text mode

- Remove --url, --api-key, --api-secret flags from agent run commands
  (already available as global flags)
- Fix console text mode: suppress UserInputTranscribed events in text
  mode to prevent duplicate/out-of-order user messages
- Clear partial transcript when switching to text mode mid-call

* Put start/dev/console/simulate behind console build tag, revert CI changes

- All agent subprocess commands (start, dev, console, simulate) require
  -tags console to build. Without the tag, they don't appear in lk agent.
- Revert .github/workflows/release.yaml and banner to main
- Remove .goreleaser.yaml (not on main)
- Move noAgentError to agent.go (non-tagged)
- Add init() registration for simulate command

* Add CI job for no-console, no-CGO build verification

* Remove build-binaries.yaml workflow

* Remove Homebrew formula

* Restore .goreleaser.yml

* Rename .goreleaser.yml to .goreleaser.yaml

* Remove console build section from README

* Add CI job for no-console, no-CGO build verification

* Read Go version from go.mod instead of hardcoding in CI

* Remove windows_arm from build matrix (no CGO, redundant with no-console job)

* Fix staticcheck: tag agent_reload, move console-only vars to agent_run

* Fix Windows build: extract platform-specific process management

* Clean up unused RoomLogCount and stale entrypoint error message

* Pin GitHub Actions to SHA references in build.yaml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants