Skip to content

fix(tracing): classify durable HITL pauses and gate raw diagnostics - #207

Merged
xfgong merged 4 commits into
cubeplexai:mainfrom
huhoo:2026-08-04-tracing-suspension
Aug 4, 2026
Merged

fix(tracing): classify durable HITL pauses and gate raw diagnostics#207
xfgong merged 4 commits into
cubeplexai:mainfrom
huhoo:2026-08-04-tracing-suspension

Conversation

@huhoo

@huhoo huhoo commented Aug 4, 2026

Copy link
Copy Markdown

Summary

  • close durable HITL activations as suspended instead of treating a valid pause as an aborted run
  • keep provider, turn, MCP, one-shot, and stream raw diagnostic content behind record_content=True
  • preserve typed error classes and lifecycle/status metadata when content recording is disabled
  • make MCP provider registration and one-shot cancellation cleanup fail-safe and deterministic
  • document the suspended tracing lifecycle and privacy contract

Why

A durable HITL activation ends with AgentSuspendedEvent, not AgentEndEvent. The recorder previously ignored that event, so the required detach cleanup closed the still-open spans as cubepi.aborted=true. A valid pause was therefore indistinguishable from cancellation.

Separately, several error paths could retain raw provider/tool diagnostics even when the tracer was constructed with record_content=False. That made the privacy switch incomplete.

Behavior

  • completed activations remain completed
  • cancelled activations remain explicitly aborted
  • durable HITL pauses now end with cubepi.run.outcome=suspended and are not marked aborted
  • record_content=False retains operational IDs, enums, model/tool names, counts, timings, token usage, and typed error classes, but excludes raw messages, arguments/results, provider descriptions, exception messages, and stack traces
  • record_stream=False continues to disable raw stream files

Validation

  • tests/tracing: 224 passed
  • full suite: 1780 passed, 90 skipped
  • Ruff check/format: passed
  • mypy: passed across 98 source files
  • independent adversarial review: 0 BLOCKER / 0 IMPORTANT
  • targeted mutations confirmed coverage for suspended-vs-aborted lifecycle, MCP registration cleanup, stream privacy, one-shot cancellation, and typed exception retention

Commits

  • 5e51086 — durable HITL pauses are suspended, not aborted
  • 550f56f — provider/turn raw errors follow content opt-in
  • 019a261 — MCP/one-shot/stream diagnostics follow content opt-in

Cue and others added 3 commits August 3, 2026 12:51
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Co-Authored-By: Claude <noreply@anthropic.com>
@xfgong

xfgong commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

@codex review

@xfgong
xfgong self-requested a review August 4, 2026 02:06
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: f947b373d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@xfgong
xfgong merged commit 15f4332 into cubeplexai:main Aug 4, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants