OpenHands / OpenHands/enterprise
Read-modify-save races on conversation metadata can clobber concurrently updated fields (title processor)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4
- Forks
- 2
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 101
Description
SetTitleCallbackProcessor fetches the conversation, polls the agent-server for a generated title (up to ~12s), then saves the ENTIRE stale snapshot via save_app_conversation_info (openhands/app_server/event_callback/set_title_callback_processor.py, ~110-148). save_app_conversation_info rewrites metrics, llm_model, and other fields from the snapshot, so any stats update that lands during the poll window is silently erased (classic lost-update).
Other read-modify-save callers of save_app_conversation_info (e.g. PR-metadata updates) have the same shape.
OpenHands/OpenHands#15354 reduces the metrics blast radius (the next stats event/run-end pull restores totals, and the cost-event ledger is append-only so per-model attribution survives), but the underlying pattern remains. Fix direction: column-specific updates (e.g. a dedicated update_title) or optimistic locking/version stamping on the metadata row.
Found while root-causing cost mis-reporting on LLM switches (#15354/#15355); confirmed by two independent code reviews.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read openhands/app_server/event_callback/set_title_callback_processor.py around lines 110-148, then trace save_app_conversation_info and the other callers mentioned in the issue. Reproduce or add coverage for a concurrent metadata update during title polling; done means title changes no longer overwrite fields updated by another operation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100