Skip to content

Projects: sender lines, not headers - #7012

Merged
enyst merged 2 commits into
claude/project-thread-xwkk9bfrom
claude/project-thread-xwkk9b-sender-line
Nov 19, 2026
Merged

enyst merged 2 commits into
claude/project-thread-xwkk9bfrom
claude/project-thread-xwkk9b-sender-line

Conversation

@enyst

@enyst enyst commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

HUMAN:

lets rename it project_sender_line() and sender_line and such. Do this in a separate PR built on 6602 branch. Just so we can see clearly what it does before merging it. Keep concepts straight. :)


AGENT:

Why

The bracketed text a message opens with ([Sent by ...], [Update from ...]) is a line in the message. Calling it a header mixed it up with HTTP headers. This PR goes into #6602's branch, so the rename can be read on its own before it goes in.

Summary

Commit 1: names only #6602 adds (Projects)

  • project_wake.project_sender_header → project_sender_line
  • In project_prompts: sender_header → sender_line, update_header → update_line, card_header → card_line, stop_header → stop_line, user_message_header → user_message_line, user_turn_header → user_turn_line, paused_header → paused_line
  • The locals, comments and tests that use them

Commit 2: names that exist on main (#6960), optional

  • message_sender.sender_header → sender_line
  • message_sender.sender_message_header → sender_message_line
  • The local header → sender_line in event_router.send_message and ConversationService's initial-message path

Commit 2 changes main's code once #6602 merges. Drop it if main's names should stay.

Not renamed: ANSWER_HEADER_PREFIX in openhands.sdk.event.ask_user. It's on main, it's public SDK API, and it names the [Answer to your question ...] line in the same sense.

No behavior change: the text of every line is the same.

Issue Number

Part of #6637.

How to Test

  • uv run pytest -n 8 tests/agent_server: 3507 passed.
  • ruff check, ruff format and pyright are clean on the changed files.

Video/Screenshots

Not a visual change.

Type

  • Bug fix
  • Feature
  • Refactor
  • Breaking change
  • Docs / chore

Notes

Base is claude/project-thread-xwkk9b (#6602), not main.

https://claude.ai/code/session_013ArwwJH94xGSYwfoyccT4E


Generated by Claude Code

claude and others added 2 commits November 19, 2026 17:33
project_sender_header -> project_sender_line, and in project_prompts
sender_header, update_header, card_header, stop_header, user_message_header,
user_turn_header, paused_header -> *_line, with their locals, comments and
tests. Only names #6602 adds.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwJH94xGSYwfoyccT4E
… -> sender_message_line

These two live in message_sender.py on main (#6960), and the local that
holds the line in event_router and conversation_service is now sender_line.
Separate commit so it can be dropped if main's names should stay.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013ArwwJH94xGSYwfoyccT4E
@github-actions

Copy link
Copy Markdown
Contributor

Agent-server conversation start benchmark

Base claude/project-thread-xwkk9b@e9147274ab0d4f40bfe7e2db714a354 vs this PR merge 68c949f741, measured in the same job on the same runner, interleaved: 5 server starts per side and scenario. Medians with 95% bootstrap CIs. The LLM is a mock that answers instantly, so this is agent-server overhead only.

base this PR change
Create conversation (warm) 0.132 s [0.118, 0.190] 0.121 s [0.117, 0.143] -8% ≈ same
↳ first agent event 0.186 s [0.161, 0.266] 0.172 s [0.162, 0.198] -8% ≈ same
First create right after server start 0.361 s [0.289, 0.763] 0.359 s [0.276, 0.394] -1% ≈ same
↳ first agent event 0.531 s [0.439, 1.340] 0.548 s [0.404, 0.615] +3% ≈ same
First create 3 s after server start 0.146 s [0.114, 0.288] 0.166 s [0.122, 0.233] +14% ≈ same
↳ first agent event 0.311 s [0.269, 0.534] 0.364 s [0.243, 0.513] +17% ≈ same
Create in a new git worktree (warm, 0.5 s git fetch) 0.691 s [0.673, 0.795] 0.743 s [0.653, 0.804] +8% ≈ same
↳ first agent event 0.754 s [0.730, 0.856] 0.809 s [0.698, 0.899] +7% ≈ same
Worktree creates that stalled the server > 20 ms 3/20 (15%) 4/20 (20%) +5 pts ≈ same
Create with one stdio MCP server (warm, 3 s startup) 1.173 s [1.135, 1.241] 1.158 s [1.135, 1.172] -1% ≈ same
↳ first agent event 3.931 s [3.789, 4.316] 3.984 s [3.875, 4.081] +1% ≈ same
Creates that stalled the server > 20 ms 5/35 (14%) 2/35 (6%) -9 pts ≈ same
Server startup (/alive) 4.863 s [4.612, 6.673] 5.166 s [4.676, 6.029] +6% ≈ same
How this is measured

Each create is a Canvas-shaped POST /api/conversations (agent profile, worktree: true, first message included, so the request waits for agent startup). A side task polls /alive every 20 ms to catch event-loop stalls. Scenarios, each on its own server starts:

  • default: a fresh directory per create, 8 creates per start.
  • pause: the first create waits 3 s after startup, as a user opening the UI would.
  • worktree: every create branches a new worktree from a local repository whose origin answers fetches after 0.5 s.
  • mcp: the agent profile enables one stdio MCP server that starts after 3 s, like an npx/uvx launch.

A timing is flagged when the 95% CIs do not overlap and the medians differ by at least 50 ms, or when a row with at least 8 samples per side moves by at least 150 ms and 25%. A create stalled the server when its slowest /alive took over 20 ms; stall rows are flagged when the share of stalled creates moves by at least 20 points with a Fisher exact p below 0.01. The first-create rows have one sample per server start, so they are flagged only on a clear change. A "↳ first agent event" row times the create above it until the agent's first event arrives on a socket opened after the create returns, as Agent Canvas does, so it includes the connect and replay. Runner: blacksmith-2vcpu-ubuntu-2404-pfohsb42f2mffkpf, 176 environment variables. Run it locally with python scripts/agent_server_benchmarks/conversation_start.py --help.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands-agent-server/openhands/agent_server
   conversation_service.py134510692%222–223, 305, 326, 358, 527–528, 675, 713, 720–721, 821, 872–873, 877, 882, 932, 984–985, 992, 1025–1026, 1042, 1074, 1078, 1091, 1111, 1132–1133, 1142, 1221, 1246, 1252–1253, 1257–1258, 1266, 1293, 1299, 1393, 1399, 1404, 1410, 1418–1419, 1428–1431, 1440, 1453, 1471, 1508, 1512–1516, 1539, 1588, 1617, 1628, 1917, 1946–1949, 2003, 2134, 2154, 2157, 2164–2166, 2169–2170, 2176, 2186, 2190, 2219, 2228, 2290–2292, 2327, 2470, 2473, 2502, 2512, 2517–2520, 2534, 2545, 2557–2558, 2591, 2692, 2761, 2819, 2834–2835, 3239, 3292, 3295
   event_router.py183597%298, 399, 410, 472–473
   project_prompts.py60297%175, 178
   project_service.py3064187%147–148, 152–156, 211–213, 225–226, 289–290, 292, 313, 340–342, 390, 398, 421, 424, 455, 488, 519–520, 556, 602–605, 682–683, 704–705, 710, 775–778
   project_wake.py3085183%92, 101–103, 105, 124, 144, 154, 188–194, 199, 221–222, 227–228, 315, 318, 356, 405, 411–413, 415, 445, 447, 482, 487, 495–496, 571–575, 589, 600, 608, 612, 626, 643, 666, 671, 685, 688, 701–702
TOTAL602682226863% 

@enyst
enyst merged commit 8729161 into claude/project-thread-xwkk9b Nov 19, 2026
16 of 18 checks passed
@enyst
enyst deleted the claude/project-thread-xwkk9b-sender-line branch November 19, 2026 18:52
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