OpenHands / OpenHands/enterprise

Read-modify-save races on conversation metadata can clobber concurrently updated fields (title processor)

Open
#69 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.