0
Fork 0
mirror of https://github.com/zeronsh/comet.git synced 2026-11-18 18:56:11 +00:00
comet/docs/chat2-sync.md

259 lines
15 KiB

A command's output keeps a short tail in the chat, with its exit code (#1168) * A command's output keeps a short tail in the chat, with its exit code Tool rows have been one-liners since the 2026-08-10 call: the doc fold dropped every tool's output, and the Claude Code and Codex adapters never sent any. A command's row could not say how it ended. Now a command (Exec: Claude Code's Bash, Codex's command execution, an ACP agent's shell call) keeps the end of its output in its tool part: its last 50 lines or 4 KB, whichever is less, with `outputBytes` (the size it came at), `outputTruncated` when earlier output was let go, and `exitCode`. Every other tool's output (file reads, searches, fetches, MCP results) is still dropped, as before. - Claude Code: a Bash result's text is its output; a leading `Exit code N` line (`Exit code 137 [killed]` too) becomes the exit code, and a result without one exited 0, unless the command went to the background. Calls are recognised by id from their tool_use (parent, subagent and typed-fork transcripts). - Codex: a command's `aggregatedOutput` and `exitCode` ride its result. - Both send only the output's last 32 KB, bounding the run journal. - The tail is redacted before it is cut (tokens, keys, credentials in urls, terminal escapes), with the redactor the sign-in flows use, moved from zeron-harness to zeron-proto so the doc fold can call it; zeron-harness re-exports it. The output is not streamed while a command runs: the doc is a Loro doc that keeps its history, so rewriting a 4 KB tail a few times a second would grow a chat by megabytes over one long build. * Command output tails: hardened redaction, no output from secret printers A command's output tail persists in the chat's doc, which syncs to the person's other devices and the cloud, so its redaction goes further than the sign-in redactor's (`redact_command_output`, beside `redact_output`): - private key blocks (PEM and OpenSSH, BEGIN through END, or to the end when cut) are dropped for one `[private key redacted]` line; - an env-style assignment (`AWS_SECRET_ACCESS_KEY=…`, `export X=…`) hides its value whatever the key; - keys naming a password, private key or webhook (`DB_PASS`, `pwd`, `private_key`, `slack_webhook`) are secret labels too, while `passed` and `compass` stay readable. Everywhere, a webhook url (Slack, Discord, Telegram bot, Teams, Zapier, …) now keeps only its host. A command that prints secrets by nature keeps none of its output, only "(output not kept: may contain secrets)": env, printenv, export -p, set, cat/head/tail of .env*, *credentials*, *.pem, *.key, id_*, .netrc, base64 -d, gpg -d, security find-*-password, pass show, op read, aws configure get, gcloud auth print-access-token, gh auth token, az account get-access-token. Pipelines, `&&`/`;` chains, sudo and shell wrappers (Codex's `zsh -lc '…'`) are looked through. * Command output tails: 10 lines / 1 KB in the chat The doc keeps a command's last 10 lines or 1 KB, whichever is less (was 50 lines / 4 KB), with its exit code, size and truncated flag as before. Redaction before the cut, line-boundary cuts, the single-long-line case and the secret-command withholding are unchanged. The parts.rs decision comment and docs/chat2-sync.md (A1) now describe this exception to the 2026-08-10 strip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Wing <44917547+wingleeio@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:00:21 -08:00