Skip to content

fix(logging): keep agent diagnostics quiet and correlated (ENG-3579) - #621

Merged
lucas-koontz merged 2 commits into
stagingfrom
fix/eng-3579-quiet-structured-logging
Oct 21, 2026
Merged

lucas-koontz merged 2 commits into
stagingfrom
fix/eng-3579-quiet-structured-logging

Conversation

@lucas-koontz

@lucas-koontz lucas-koontz commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

User story

As an on-call engineer
I want quiet, correlated diagnostics
So that I can diagnose failures without exposing customer data

Why this matters

Operators currently sift through agent chatter to find a failed turn. JSON diagnostics now default to WARNING and retain safe exception locations and conversation correlation. Cloud-turn JSONL and the separate usage stream keep their existing contracts.

Visual review

A deployed before/after capture remains a rollout gate for this runtime. Local regression and container evidence below establish behavior, not a production volume reduction.

Acceptance criteria

  • The packaged resident launcher uses the same safe formatter and WARNING default for setup/fork failures while preserving forked-turn root logging.
  • Owned diagnostics default to WARNING with a consistent JSON envelope and safe failure fields.
  • Exception values, credentials, provider bodies and arbitrary extras are excluded from diagnostic output.
  • Cloud-turn output and usage records remain independent; request context resets after each turn.
  • Override/reset and rollback behavior are documented in docs/structured-logging.md.
  • Deployed versions, collector mappings, alerts, retained operational evidence and matched rollout windows are verified.

How to test

  1. From an initialized Linux checkout, run uv run pytest tests/test_diagnostics.py tests/test_cloud_turn_resident.py tests/test_cloud_turn_provider_logging.py tests/test_image_smoke.py.
  2. Exercise an ordinary success, a final refusal and a dependency or streaming failure. Check safe JSON and correlation, and confirm protocol/output contracts remain unchanged.
  3. Enable the documented temporary verbosity/access override, repeat the checks, then reset it. Confirm failed health checks or operational failures remain visible at the quiet default.

Notes for the reviewer

  • Publish the package before consumers. Source changes do not update installed agent packages or scratchpad images.
  • Use the maintained structlog processor. The adapter stays with this independently released runtime; no shared logging package or release coupling is introduced. Lock regeneration normalized platform markers without changing existing dependency versions.
  • Rollback uses the prior release and settings together. Do not disable audit, metric or protocol streams to quiet diagnostics. Live collector and alert validation remains a release gate.

Current review validation

The resident entrypoint regression failed in all four JSON/text and default/DEBUG combinations before the fix. The final affected suite passes all 62 cases in the Linux Python 3.12 container, including resident lifecycle and image smoke tests; Ruff and diff checks pass. Local macOS coverage passed 42 cases with 20 Linux-only skips before the Linux rerun.

The combined source API/web arm64 images also rebuilt successfully. Container smoke verified the installed Anton version 2.26.10.21.2rc3.dev2+gb73859e9f, matching this commit, alongside the reviewed server version. It passed health/routing, refusal visibility and private-value exclusion; it does not establish provider-backed agent turns or a released package.

The hosted workflow also passed its test suite and checks on this commit.

Earlier validation

These broader results precede the resident follow-up:

Check Observed result
Full suite before assertion updates 7,610 passed, 271 skipped; two old text-log assertions failed and were updated.
Final affected suites 43 passed: diagnostics, cloud process and provider-error behavior.
Regression sensitivity Each new diagnostic test failed with its protected behavior removed; restored tests pass.
Pre-PR checks Diff integrity and the repository sweep passed; regression mutations were restored.

Ships with

mindsdb/cowork-server#741, mindsdb/cowork#1263, mindsdb/data-vault#5, mindsdb/mindshub#12504.

Merge/release order: #621, then mindsdb/cowork-server#741, then mindsdb/cowork#1263. mindsdb/data-vault#5 can proceed independently. Update reviewed release pins and rebuild mindsdb/mindshub#12504 last.

@lucas-koontz
lucas-koontz merged commit bf3b2d3 into staging Oct 21, 2026
9 checks passed
@lucas-koontz
lucas-koontz deleted the fix/eng-3579-quiet-structured-logging branch October 21, 2026 16:29
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants