Skip to content

fix(dashboard-api): tolerate evicted or missing attempts during pixel chat cancel - #5695

Merged
gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-cancel-evicted-attempt
Sep 19, 2026
Merged

gabsprogrammer merged 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-cancel-evicted-attempt

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/routers/pixel.py, pixel_chat_cancel handles client Stop actions for ongoing conversation attempts. When edge cancellation succeeds (aborted = True), the routine checked whether the attempt had completed using if store.get(identity)["state"] == "complete": without verifying that store.get(identity) returned a non-null record. If an attempt record was concurrently cleaned up, expired by retention, or evicted before edge cancellation or worker task cancellation completed, store.get(identity) evaluates to None. This triggered an unhandled TypeError: 'NoneType' object is not subscriptable, causing an unexpected HTTP 500 internal server error instead of failing closed with {"aborted": False}.

This change guards store.get(identity) results before inspecting receipt state, safely treating missing or evicted attempts as non-completing (aborted: False) without raising unhandled exceptions. Existing attempt admission locks (_result_stops), background task cancellation, edge cancellation signaling, and receipt completion status remain untouched.

Validation

  • Baseline reproduction: on unpatched code, cancelling an attempt that became missing or evicted during edge cancellation raised TypeError: 'NoneType' object is not subscriptable in pixel_chat_cancel, failing test_cancel_handles_evicted_or_missing_attempt_without_typeerror.
  • Post-fix behavior: missing/evicted attempt lookups cleanly return {"aborted": False} without unhandled exceptions.
  • Telemetry statement: "Pixel chat results suites: 20 passed. New-test diff checks pass; new regressions wired into test_pixel_chat_results.py."

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens dashboard chat cancellation error resilience against concurrent attempt eviction, not edge stream lifetime. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5693 and #5607 at 4fa6ad1 without conflicts. Production and test diffs passed together; edge streaming, token auth, and context projection checks remain intact.
Backlog composition was local-only (production/test diffs, excluding workflow/Makefile wiring); it is not an upstream merge or independent human approval. Declared live-review gates remain open.

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