Skip to content

fix: preserve stream error status - #1435

Open
KXHXK wants to merge 1 commit into
AgentOps-AI:mainfrom
KXHXK:fix/stream-error-status
Open

fix: preserve stream error status#1435
KXHXK wants to merge 1 commit into
AgentOps-AI:mainfrom
KXHXK:fix/stream-error-status

Conversation

@KXHXK

@KXHXK KXHXK commented Jul 25, 2026

Copy link
Copy Markdown

Description

Fixes #1434.

The common synchronous and asynchronous stream wrappers currently mark a span as ERROR when iteration raises, then overwrite that status with OK during finalization. This change keeps final attribute collection and span closure intact while skipping the success status after an iteration failure.

Both wrapper variants now have regression coverage asserting that the emitted status remains ERROR.

Testing

  • tests/unit/instrumentation/common: 56 passed
  • ruff check: passed
  • ruff format --check: passed
  • git diff --check: passed
  • secret-pattern scan of changed files: passed

Direct mypy agentops/instrumentation/common/streaming.py reports the pre-existing unannotated accumulated_content list on line 36; the same line is present on upstream/main and is outside this patch.

@KXHXK
KXHXK marked this pull request as ready for review July 26, 2026 10:19
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.

Stream finalization overwrites iteration errors with OK status

1 participant