Skip to content

perf: SDK and agent-server performance and correctness issues from profiling investigation #3153

Closed
19 of 19 issues completed

Description

@csmith49

Overview

Profiling investigation of openhands-sdk v1.19.1 and openhands-agent-server v1.19.1 uncovered 19 performance and correctness issues across the SDK and agent server. This tracking issue organizes them by severity.

Methodology: Austin wall-time stack sampling profiler + targeted benchmarks using TestLLM (scripted responses, zero LLM cost) to isolate SDK/server overhead from LLM latency. Conversations scaled from 50 to 2000 steps, 1 to 16 concurrent threads.

Broadly related upstream work:

Critical — Correctness and scaling blockers

High — Significant performance and resource issues

Medium — Optimization opportunities

Key findings summary

Finding Severity Impact
O(N²) per-step cost from full-history rescan Critical 9.1× slowdown at 2000 steps
GIL prevents threading from scaling Critical Flat throughput regardless of thread count
atexit leak pins conversations in memory Critical OOM on long-running servers
litellm.modify_params race condition Critical Silent LLM call corruption
os.environ credential bleed Critical Cross-tenant credential exposure
SpanManager global stack Critical Broken distributed tracing
Eager conversation loading at startup High O(N) startup time
No eviction for finished conversations High Monotonic memory growth
O(N) conversation search/count High Slow list API at scale
Default thread pool, no backpressure High Silent queuing of conversations
Lease renewal I/O storm High ~33 file ops/s at 500 conversations
ConversationState autosave per mutation High 10-100× excess I/O per step
Unbounded InMemoryFileStore cache High ~500 MB at 500 conversations
send_message TOCTOU race High Double-execution of conversations
Hook subprocess fork per tool call High 150 forks per 50-step conversation
ToolExecutor close() never called High Resource leak on conversation close
forgotten_event_ids list not set Medium O(V×F) condensation
Sequential PubSub dispatch Medium Slow client blocks all subscribers
Unbounded WebSocket connections Medium No limit on per-conversation connections

This issue and its sub-issues were created by an AI agent (OpenHands) on behalf of the user, based on profiling investigation findings from May 2026.

Sub-issues

Sub-issues

19 of 19 Issues completed
Loading 19 sub-issues

Activity

  1. added
    bug
    performance
    on May 8, 2026
  2. self-assigned this
    on May 8, 2026
  3. jamiechicago312 commented on Jun 25, 2026

    @jamiechicago312
    Contributor

    👍 Also experiencing this on the agent-canvas dev stack (Windows, openhands-agent-server v1.28.1, ~89 persisted conversations). The eager startup resume alone accounts for ~40 s before /server_info returns 200, which is the dominant user-visible cost of npm run dev. Detailed log evidence plus an adjacent observation about secrets being re-attached to dormant conversations on resume is on #3140.

    (This comment was drafted by an AI agent (OpenHands) on behalf of the user.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugperformance

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions