calm-artist-7206
02/26/2026, 11:43 PMnutritious-balloon-65098
02/26/2026, 11:44 PMnutritious-balloon-65098
02/26/2026, 11:51 PMopenhands/fix-conversation-link-pr-body
- Committed + pushed two commits:
1) Code + test fix to propagate conversation_id into MCP tool initialization (so MCP requests include X-OpenHands-ServerConversation-ID, restoring the conversation link appended in PR/MR bodies).
2) A small AGENTS.md note documenting this linkage (so we don’t regress again).
- Opened a draft PR: https://github.com/OpenHands/OpenHands/pull/13092
- Validation:
- Ran poetry run pytest -q tests/unit/mcp/test_mcp_utils.py (pass)
- Ran poetry run pre-commit run --config ./dev_config/python/.pre-commit-config.yaml (pass)
### Checklist against your request
- [x] Found where the conversation link is appended (MCP server route)
- [x] Identified the V1 regression (missing conversation_id propagation → missing header)
- [x] Implemented the fix in the codebase
- [x] Added a regression test
- [x] Pushed changes and opened a PR to fix it
### Conciseness / extraneous changes check
- The only extra beyond the fix+test is the AGENTS.md note; it’s directly related (documents the requirement for the header) and is small. No other unrelated changes were included.calm-artist-7206
02/27/2026, 12:04 AMnutritious-balloon-65098
02/27/2026, 12:04 AMnutritious-balloon-65098
02/27/2026, 12:07 AMX-OpenHands-ServerConversation-ID is read by the MCP create_pr route and how that value is used to append a conversation link into the PR body/description (openhands/server/routes/mcp.py).
- [x] Found where the MCP client sets that header when it is provided a conversation_id (openhands/mcp/client.py).
- [x] Identified the regression: MCP tools were being initialized without forwarding the conversation id, so the header was missing and the PR body footer/link stopped being appended.
- [x] Implemented the fix by propagating conversation_id through MCP tool initialization:
- openhands/mcp/utils.py (plumb conversation_id into fetch_mcp_tools_from_config(...))
- openhands/server/session/agent_session.py (pass conversation_id=self.sid)
- openhands/core/main.py (pass conversation_id=sid)
- [x] Added a unit test to prevent regression: tests/unit/mcp/test_mcp_utils.py
- [x] Ran Python pre-commit hooks + unit test(s) locally.
- [x] Pushed the fix branch and opened a draft PR: https://github.com/OpenHands/OpenHands/pull/13092
- Branch: openhands/fix-conversation-link-pr-body
- [x] Added a small repo memory note in AGENTS.md explaining that the PR-link footer depends on this header propagation (to help avoid future regressions).
Conciseness check
- The code changes are limited to the MCP header propagation path + a regression test.
- The only “extra” change is the short AGENTS.md note, which is directly related to preventing this specific regression from reoccurring.
Next step (your choice)
Do you want me to keep PR #13092 as draft, or should I update it to be ready for review once you’ve had a look?calm-artist-7206
02/27/2026, 12:12 AMopenhands/core/main.py is from V0, so how could it have worked without the arg, and now you suddenly tell me it needs the arg?
Note: V1 is thecurrent version, you can find its code on the execution path of openhands/app_server.
You need to be careful. Some big part of the codebase is the legacy V0 code.
I think in V0 resolver it worked, in V1 resolver it doesn;tnutritious-balloon-65098
02/27/2026, 12:12 AMnutritious-balloon-65098
02/27/2026, 12:19 AM