Repository navigation
Commit b337f8b
feat(debug): debug mode that survives a crash, and
* feat(debug): debug mode that survives a crash, and `altimate debug bundle`
When Altimate Code hung or closed, neither opencode.log nor telemetry showed what
it was doing: tool calls were not logged, the log never recorded the version,
and telemetry only reports an attempt once it finishes.
Debug mode (`ALTIMATE_DEBUG=1`):
- every tool call is written to opencode.log when it starts and ends, with its
duration; while a call runs, a heartbeat line every 15 s names what is still in
progress. Lines are appended synchronously, so the last ones survive a hang the
user kills or a crash;
- raises the log level to DEBUG unless `--log-level` is given.
Always on:
- one line per process start (main and TUI worker) with version, OS, terminal,
TTY and whether debug mode is on;
- every event-loop stall is written to the log (before the telemetry cap).
`altimate debug bundle [--output <path>] [--no-network]` writes one Markdown
report that leads with detected problems in plain language, then the evidence:
version and install method, OS and terminal, proxy hosts, settings in the
environment (names only), telemetry state, the Altimate account, warehouse
connections (type, sign-in method, field names, and whether a password is
actually retrievable), MCP servers, reachability of the hosts this install uses,
a log summary (runs that ended mid-tool, connection failures, MCP start failures,
starts per day, stalls, repeated warnings) and the last 300 log lines. Passwords,
keys, tokens, PEM blocks, emails, URL queries, the home folder and the user name
are removed from the whole report. It is written locally; nothing is uploaded.
`fileLog` appends lines to opencode.log in the Effect logger's format: `Log.create`
writes to stderr only with print-logs on, so it could not serve either purpose.
Docs: troubleshooting "Debug Mode" rewritten; `debug` and `ALTIMATE_DEBUG` in the
CLI reference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fJ3X7pcGT4R9yzjsJnqsV
* fix(debug): redact every secret form, judge connections as the driver sees them, and run without starting the project (review)
Consensus review fixes.
Redaction:
- A secret key is matched as a suffix in any case (`client_secret`,
`access_token`, `PGPASSWORD`, `aws_secret_access_key`, `accessToken`).
- Quoted values are removed whole.
- Queries are removed from any `scheme://` URL, and `scheme://user:secret@`
loses the secret.
- The computer's name is removed too.
- A user name that is an ordinary word ("code") is replaced only where it
is used as a name.
Connections:
- Each connection is classified with its secrets filled back in from the
credential store, so working token, key-pair, BigQuery key-file and
connection-string connections are no longer "missing a password".
- BigQuery with no key file (default credentials) is not a problem.
`debug bundle`:
- Runs without a project instance, so a hang in plugins, LSP or snapshots
cannot hang it, and it does not write into the log it reads.
- MCP servers are read straight from the config files.
- `--no-network` now means no network at all: telemetry is not started.
- Telemetry status waits for telemetry to finish starting; telemetry is
probed only when on, at its configured endpoint.
- One deadline covers DNS too; DNS is skipped behind a proxy.
- Only HTTPS warehouses are probed (Snowflake, Databricks), and the docs
now say so.
- The report is written readable by the owner only (0600).
Unfinished tool calls:
- One counts as a crash only when the process that ran it has ended (pid
from the start line).
- One in a still-running process is not reported; one with no pid is a
warning marked unconfirmed.
- The trace ends before the tool title is built, so a throwing label
cannot leave a finished call "running".
- The heartbeat stops when nothing is running, and fallback call ids use a
counter.
Tests: redaction forms, liveness, connection classification, probe
deadline and proxy, MCP config reading.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018fJ3X7pcGT4R9yzjsJnqsV
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>altimate debug bundle (#1409)1 parent 51b04a2 commit b337f8b
15 files changed
Lines changed: 1392 additions & 6 deletions
File tree
- docs/docs
- reference
- usage
- packages/opencode
- src
- altimate
- debug
- telemetry
- cli
- cmd/debug
- tui
- tool
- test
- altimate/debug
- cli/help/__snapshots__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
249 | 251 | | |
250 | 252 | | |
251 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
252 | 266 | | |
253 | 267 | | |
254 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
255 | 277 | | |
256 | 278 | | |
257 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| 83 | + | |
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
| |||
0 commit comments