Skip to content
Edit this page View source of this page

Troubleshooting

First checks

pegg version      # confirm what you are running
pegg files        # where config, logs, cache, and sessions live
pegg doctor       # test every configured provider and check for updates
pegg config show  # print the resolved config (API keys masked)

Logs

Pegg logs to SQLite by default. Every command, request, tool call, and error is recorded in ~/.pegg/logs.db.

pegg logs                          # most recent 50 entries
pegg logs --level ERROR            # only errors
pegg logs --search "provider"      # substring search in message and level
pegg logs --level DEBUG --size 200 --page 2

If logger.driver is console, pegg logs prints only the current process's in-memory buffer instead. Switch back to "sqlite" in Config to persist logs.

To increase verbosity, set logger.level to "debug" in Config, or run with PEGG_DEBUG=1 for a single process. Then query with pegg logs --level DEBUG.

Cache

Model lists and model metadata are cached locally. Stale cache is the usual cause of "model not found" after a provider adds new models.

pegg cache clear                        # clear everything
pegg cache clear --provider openai      # clear one provider
pegg providers refresh                  # re-fetch models from the network
pegg providers refresh --provider openai

Cache files: ~/.pegg/cache.db (SQLite driver) or ~/.pegg/cache.json (JSON driver).

VS Code extension

The VS Code extension has its own output channel and ACP process. Open Pegg: Show Logs and Pegg: Restart Server when something looks stuck. The extension uses the same config and session database as the CLI.

The extension cannot find a Pegg binary

Run Pegg: Install or Update Binary, set pegg.executablePath, or allow <workspace>/bin/pegg with pegg.binary.allowWorkspaceBinary. The extension prefers the workspace binary, then PATH, then a verified download.

The extension says the Pegg binary is too old

Update the binary with Pegg: Install or Update Binary, or point pegg.executablePath at a newer build. Older ACP servers do not support interactive permissions, model switching, or rich tool events.

No models or providers in VS Code

Run Pegg: Provider Login, Pegg: Connect Team, or open Pegg: Open Global Config. After changing providers, run Pegg: Restart Server.

Opening chat creates a new session every time

That is expected: opening a new chat starts fresh. Resume with Pegg: Resume Session or the Sessions tree. The current session is marked in green. If the engine exits unexpectedly mid-run, the next message resumes the same session.

Voice input fails in VS Code

Recording happens on the machine running Pegg, not in the webview. Install sox, arecord, or ffmpeg there, verify the microphone works, and configure stt.provider/stt.model. Remote and WSL windows use the remote microphone.

A permission prompt does not appear

Update the Pegg binary and retry. If the Pegg chat view is hidden, the extension falls back to a VS Code modal prompt.

Common problems

pegg: command not found right after the install script

The installer falls back to ~/.local/bin when /usr/local/bin is not writable, which is the common case on macOS. That directory is not on the default PATH, so the binary is installed but unreachable.

The installer appends the export to your login shell's profile itself, but the shell that ran it still needs to pick the change up:

exec $SHELL -l

For an older installer, or when PEGG_NO_PATH was set, add it by hand — use ~/.zshrc for zsh, ~/.bash_profile on macOS bash, ~/.bashrc on Linux bash:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
exec $SHELL -l

On fish:

fish_add_path ~/.local/bin

Verify with command -v pegg. Installing to a directory that is already on your PATH avoids the step entirely:

curl -fsSL https://pegg.dev/install | PREFIX=/usr/local/bin sudo bash
cli: no providers configured or an empty provider list

No provider has been added yet. Run pegg login or add an entry to the providers array in ~/.peggco/pegg.json.

cli: model \"x\" not found

The model is not in the local cache. Refresh and try again:

pegg providers refresh
pegg models

Model matching is case-sensitive and checks both the model ID and its display name.

cli: timed out selecting model

Model resolution waits 30 seconds for the LLM manager to become ready. This happens when providers are still syncing, no provider is reachable, or the cache is empty. Run pegg doctor to see which providers fail, then retry. Passing --provider and --model explicitly skips the selection step.

update binary: executable not found in zip file: \"pegg\"

Builds older than v0.2.4 have no release asset filter, so self-update on macOS picks the desktop bundle (pegg-desktop_*_darwin_*.zip) instead of the CLI archive. That zip only contains pegg-desktop, hence the error. Install v0.2.4 or newer once; later auto-updates select the right asset:

curl -fsSL https://pegg.dev/install | sh

The installer derives the asset name from uname (pegg_<os>_<arch>.tar.gz, or .zip on Windows), so it never picks the desktop bundle. Pin a version with VERSION=v0.2.4 and choose a directory with PREFIX=$HOME/.local/bin.

pegg team browser cannot connect to 127.0.0.1

The team callback is a loopback URL on the machine running pegg. Over SSH you must forward the same port to the server:

# server
pegg team --no-browser --port 8765

# laptop
ssh -L 8765:127.0.0.1:8765 user@server

Open the printed URL and approve. If the SSH session is already open, use the OpenSSH escape ~C followed by -L 8765:127.0.0.1:8765. The port must match --port, and the local port must be free. If AllowTcpForwarding is disabled on the SSH server, connect locally and copy the resulting ~/.pegg/pegg.json, or use a public team service URL.

pegg team returns provider check failed or connection refused

The CLI reached the website but could not reach the team service returned as the provider base URL. Check TEAM_SERVICE_URL in the ginit environment and make sure the machine running pegg team can reach it. If the team service runs on your laptop, forward it with ssh -R 8081:127.0.0.1:8081 or use a public URL.

Also check that https://pegg.dev is reachable from the same machine.

pegg team returns 401 or 503 team_store_unavailable

401 means the team gateway rejected the API key. Retry after the embedded replica sync interval, or lower DATABASE_SYNC_INTERVAL in the team service environment. 503 team_store_unavailable means the gateway's database or the team_ai_* tables are unavailable; run ginit migrations and check the team service logs.

pegg team keeps creating a new API key

The CLI reuses a key only when it can decrypt the stored per-team/user CLI credential. Revoking the key, rotating BYOK_ENCRYPTION_KEY, or deleting the key removes that ability. Connect again to create a new key. Website-created keys are not reused because only their hash is stored.

HTTP 401 / 403 from a provider

The API key is missing, expired, or lacks access to the model. Re-run pegg login --provider <name>, or check the key in pegg config show.

HTTP 429 or 5xx responses

Temporary errors are retried automatically with a 1s, 3s, 10s, 30s, 1m, 5m backoff. If the run keeps failing, wait for the rate limit to reset, switch to another provider, or lower concurrency.

A provider request hangs with no response and no error

Pegg's stall middleware watches the stream for silence. If no chunk arrives for stall.timeout_secs (default 10), it cancels the attempt and re-issues the same request at the same point in the run loop. A successful retry is silent. Tune the window or disable the middleware in pegg.json:

{
  "stall": {
    "enabled": true,
    "timeout_secs": 10,
    "max_retries": 0
  }
}

max_retries: 0 retries indefinitely. If content has already been streamed, Pegg does not retry — it returns an error instead of duplicating partial output.

Model does not support image/audio attachments

The selected model's metadata does not list that input modality (image, audio, or video). Choose a multimodal model, or remove the attachment. Elsewhere the file is still stored and handed to the agent by path, so it can read it with its tools.

A tool is blocked by a permission prompt or denied

Pegg asks before running gated tools (or consults the judge LLM, depending on the mode). Denials are remembered in ~/.pegg/permissions.json, keyed by the tool call arguments. See Permissions.

To reset every remembered decision:

rm ~/.pegg/permissions.json
An MCP server does not connect

Check the server definition and run Pegg with the sqlite logger, then inspect pegg logs --search mcp. Common causes:

  • The command is not on PATH (stdio transport).
  • The url is not reachable or does not emit an endpoint event (legacy SSE transport).
  • A Streamable HTTP server returns errors after a restart (expired session; Pegg re-initializes automatically on 404) or requires headers that are not configured.
  • The server fails its initialize handshake or lists no tools.

Connection failures are logged as warnings and the server is skipped; the rest of Pegg keeps working.

pegg mcp list
pegg mcp tools --server db
No LSP diagnostics appear in file reads

Diagnostics require a language server whose filetypes match the file. Servers start lazily on first access and are stopped after 10 minutes idle. If the binary is missing, Pegg tries the configured download URL or install command.

pegg lsp list
pegg lsp diag --file src/main.go

See LSP.

Config file fails to parse

~/.peggco/pegg.json must be valid JSON. Validate it with your editor or jq . ~/.peggco/pegg.json. A missing file is fine; a malformed one aborts startup.

The TUI looks wrong or the terminal is unsupported

Try a different theme with Ctrl+T (the choice is saved). The TUI enables mouse and bracketed paste support when the terminal provides it; if the terminal misbehaves, resize the window or switch to the CLI with pegg run.

The agent keeps running and I want to stop it

Press Esc twice within two seconds. The first press shows Press Esc to interrupt; the second cancels the run and all subagents. Ctrl+C quits the whole application.

Sessions disappeared or moved

Sessions are filtered to the current project directory by default. List them all with:

pegg sessions list --all

Session storage lives in ~/.pegg/sessions.db (SQLite driver) or ~/.pegg/sessions/ (JSON driver). See Sessions.

Reset to defaults

Remove pieces selectively, or everything:

rm ~/.pegg/permissions.json    # forget tool approvals
rm -rf ~/.pegg/vfs             # forget read-before-edit state
pegg cache clear               # rebuild model cache
rm ~/.peggco/pegg.json         # regenerate default config (loses providers)
rm -rf ~/.pegg                 # full reset: config, sessions, logs, cache

Reporting issues

If the problem persists, open an issue at github.com/peggco/pegg/issues with:

  1. The output of pegg version and your OS/architecture.
  2. Relevant log lines (pegg logs --level ERROR).
  3. A redacted copy of pegg config show (keys are masked already).
  4. Steps to reproduce, including the exact command or prompt.