Repository navigation
fix(agent-server): ignore a non-object base_state.json in the status index - #6592
Merged
Merged
Conversation
…index _read_execution_status_sync suppressed OSError and ValueError, but a base_state.json holding valid JSON that is not an object (e.g. []) made payload.get raise AttributeError, which failed every status-filtered search and count. Suppress it too, so the cached status is kept as for the other corrupt cases.
Contributor
Coverage Report •
|
||||||||||||||||||||
Contributor
REST API breakage checks (OpenAPI) — ✅ PASSEDResult: ✅ PASSED |
Closed
75 of 86 tasks
VascoSch92
marked this pull request as ready for review
November 7, 2026 16:24
all-hands-bot
approved these changes
Nov 7, 2026
all-hands-bot
left a comment
Collaborator
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Scope
In scope for this repository: _read_execution_status_sync is the agent-server status index reader behind status-filtered search_conversations/count_conversations, and the change implements the pinned item from #6348 (open, bug, ready-for-dev). No product or architecture decision is required.
Fix verified in the workspace
payload.get("execution_status", ...)(conversation_service.py:524) raisesAttributeErrorfor a non-object JSON payload ([],"x",1), and the single call site_refresh_persisted_statuses_sync(:924, invoked viaasyncio.to_threadfrom_refresh_execution_statuses) let it escape, failing every status-filtered listing and count while such a file existed. AddingAttributeErrorto thesuppress(...)makes_read_execution_status_syncreturnNone, which the caller already maps to "keep the cached status, unverified, retry on a later query" — the same documented semantics as a truncated file or an unknown enum value. Recovery is preserved because_state_signatureis mtime+size based, so a later valid rewrite is re-read.- No over-broad masking: within the suppress block only
open,json.loads, andConversationExecutionStatus(...)run;json.loadsdoes not raiseAttributeError, and invalid enum values already raise the intendedValueError. The only newly suppressed case is the non-mapping.getthis PR targets. - No public Python/REST/OpenAPI surface changes; private module-level helper only (OpenAPI breakage check green).
Tests and evidence
- The added test is byte-identical to the pinned test in #6348 modulo removal of the
strictxfail marker, which the issue's protocol requires in the fixing PR. - I reproduced the bug on
mainin a disposable worktree (no tracked files modified) by applying only the test patch: thenon-objectcase fails with exactlyAttributeError: 'list' object has no attribute 'get'escaping via_refresh_persisted_statuses_sync, whiletruncated/bad-enumpass. On this head the full class passes (8/8) andtests/agent_server/test_conversation_service.pypasses 148/148. - GitHub Actions on this exact head (
70a4d42d…) is green, includingagent-server-tests,agent-server-stress-tests,integration-test,cross-tests,windows-tests,security, andpre-commit(verified run head SHAs match).
No material findings.
✅ APPROVED
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HUMAN:
just fixing a bug
AGENT:
Why
Status-filtered
search_conversations/count_conversationsread justexecution_statusfrom eachbase_state.jsonthrough_read_execution_status_sync, which suppressesOSErrorandValueErrorso that one unreadable or corrupt file keeps its cached status. A file holding valid JSON that is not an object ([],"x",1) gets pastjson.loads, andpayload.get(...)raisesAttributeError. That escapes the reader, so every status-filtered listing and count fails while that file exists.Summary
AttributeErrorto thesuppress(...)around the read, so a non-object payload is handled like a truncated file or an unknown status.TestConversationSearchScaling, with itstruncatedandbad-enumcases (already passing) and thenon-objectcase without itsxfailmarker.Issue Number
Part of #6348 (item: "_read_execution_status_sync only suppresses OSError/ValueError; a non-object payload raises AttributeError and fails every status-filtered count").
How to Test
The
non-objectcase fails onmain(AttributeError: 'list' object has no attribute 'get') and passes here; the class passes (8).Type
🐳 Agent Server images for this PR — GHCR package, pull/run commands, and all pushed tags (click to expand)
• GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server
Variants & Base Images
eclipse-temurin:17-jdkpython-node-runtimepython-node-runtimepython-node-runtimegolang:1.21-bookwormPull (multi-arch manifest)
# Each variant is a multi-arch manifest supporting both amd64 and arm64 docker pull ghcr.io/openhands/agent-server:70a4d42-pythonRun
All tags pushed for this build
About Multi-Architecture Support
70a4d42-python) is a multi-arch manifest supporting both amd64 and arm6470a4d42-python-amd64) are also available if needed