Skip to content

fix(dashboard-api): tolerate evicted unresolved attempts during pixel chat result retrieval - #5699

Closed
vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-result-evicted-unresolved-attempt
Closed

vaibhavsrv wants to merge 1 commit into
Osmantic:public-betafrom
vaibhavsrv:fix/pixel-result-evicted-unresolved-attempt

Conversation

@vaibhavsrv

Copy link
Copy Markdown
Contributor

Why this matters

In ods/extensions/services/dashboard-api/routers/pixel.py, pixel_chat_result(...) queries durable attempt receipts for an owner via _result_state(store, key). If an attempt's state is "unresolved" (for example, after a worker crash or process restart), the handler calls pixel_chat_activity(...) to check whether the underlying run reached a terminal state, marks it interrupted via store.finish(key, "interrupted"), and re-queries the attempt row with row = store.get(key).

If the attempt row was evicted by retention policies, store capacity bounds, or concurrently purged between the terminal transition and store.get(key), row becomes None. The handler subsequently attempted to evaluate events = b"" if row["state"] == "active" else ..., which raised an unhandled TypeError: 'NoneType' object is not subscriptable and failed the endpoint with HTTP 500.

This surgical fix guards row following the unresolved terminal reconciliation check, returning {"state": "unknown", "events": ""} if the attempt row is no longer present in the store.

Validation

  • Baseline reproduction: Tested retrieval of an unresolved attempt where the row was evicted after being marked interrupted on unpatched pixel.py; baseline crashed with TypeError: 'NoneType' object is not subscriptable.
  • Post-fix behavior: Handler safely handles missing/evicted rows, returning {"state": "unknown", "events": ""}; all 20 chat result tests pass cleanly.
  • Telemetry: pixel chat result suites: 20 passed. New-test syntax and diff checks pass; new regressions wired into test suite.

Overlap check

Risk / AI disclosure

AI-assisted investigation, implementation and CLI regressions. This strengthens missing-row null-safety in the chat result endpoint and does not alter store semantics or contract formats. Independent human review and platform/runtime qualification remain gates. No running configuration, deployment or upstream merge changed.

Follow-up integration evidence

Composed with #5698 at 35ec0d4e0 without conflicts. Production and test diffs passed together; result store and cancellation 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.

@Lightheartdevs

Copy link
Copy Markdown
Collaborator

Thanks for this contribution. public-beta was promoted into main on 2026-09-24 and no longer receives changes, so we're closing pull requests that target it. This isn't a judgment on the change itself. If it's still needed, please rebase onto main and open a focused PR. See #7253 for details and the contribution policy.

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