Skip to content

refactor(logging): collapse double-log storms, fix levels, correlate ids - #1430

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-10661-logging-cleanup-collapse-storms-fix-levels-add-correla
Oct 15, 2026
Merged

TheGreatAxios merged 3 commits into
mainfrom
cl-10661-logging-cleanup-collapse-storms-fix-levels-add-correla

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Collapses second-layer duplicate logs to single honest entries: store-settlement and submit sent-append paths, plus per-file approval-store-migration warns that now fold into one summary warn carrying a per-file error shape on the migration result (pinned by a log-capture test that lists each skipped store).
  • Fixes mis-leveled entries: agent-fleet cleanup error→warn; tui/runner/mcp late-connect/retry errors→warn with server correlation; summarizer retry-path warns and otel-sink soft-skip warns demote to debug (terminal failure still warns — no suppressed terminal error).
  • Introduces one shared caughtDebug append-failure helper replacing 15+ per-site catch closures in settings/exit/dispose/runner paths; all migrated message templates byte-identical (parity checked site-by-site). The exec/exit error paths it guards now carry sessionId from where the id is already in scope — scope-honest, no new threading.
  • Removes dead .catch() handlers on a never-rejceting pricing load (fallback path verified internal to loadPricing).
  • The collapsed per-entry path resolution uses an explicit lambda so map's (value, index, array) triple can never reach path.resolve (probe-verified crash shape from the plan draft, avoided — the pre-existing committed loop was already safe).

Verification

  • bun run check exit 0: 8968 pass / 0 fail across 584 files; scoped trust/logging/permission suites 74 pass / 0 fail.
  • Log contract pinned: caughtDebug normalization/append tests (Error→message, non-Error→String, sanitizer composition) plus the migration summary-warn capture test.
  • Explicit non-changes respected: smoke.ts probe, stderr user channel, sink debug default, reactor-authorize pair — all untouched (diff-verified).
  • One caveat: this branch rides the sandbox adoption branch (feat(shell): opt-in os sandboxing via sandbox-runtime #1428) — its e1c3faf3→1bfc0735 base carries this commit's parent.

Fixes CL-10661

Second-layer duplicates (store settlement, submit sent-append) collapse
to single entries; per-field trust warn storms become one summary warn,
with a per-file error shape on the migration result. Mis-leveled errors
demote to warn; warn churn during teardown demotes to debug. caughtDebug
is the single append-failure helper for persist/teardown catches. The
exec/exit error paths it guards carry sessionId from where the id is
already in scope; the MCP late-connect/retry warns name the server.

The collapsed per-entry absolute resolution uses an explicit lambda
(paths.map((p) => resolve(p))) so map's (value, index, array) triple
can never reach path.resolve — avoiding the plan draft's would-crash
shape (probe-verified: restoring bare .map(resolve) fails the trust
store suite with ERR_INVALID_ARG_TYPE). The parent commit always had
the safe per-entry loop; nothing here fixes a shipped crash. The
migration's one-summary-warn contract is pinned by a log-capture test
listing each skipped store.
@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

CL-10661

@corbits-triage

corbits-triage Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by the comment below.

@corbits-triage

corbits-triage Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by the comment below.

@corbits-triage

corbits-triage Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Triage: Pass

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios changed the base branch from cl-10663-shell-sandboxing-adopt-sandbox-runtime-opt-in-fail-closed to main October 15, 2026 21:18
…nup-collapse-storms-fix-levels-add-correla

# Conflicts:
#	src/tui/runner/exit.ts
A final steer whose promise rejects was silent after settlement. Log that
failure again with the same id and error shape as the handoff path, and
drop the narration comments added with the collapse.
@TheGreatAxios
TheGreatAxios merged commit efc3596 into main Oct 15, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant