OpenHands / OpenHands/software-agent-sdk
agent-server profile pre-flight ping: prepend a system message
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 539
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 137
Description
Problem
The agent-server profile pre-flight validation in openhands-agent-server/openhands/agent_server/profiles_router.py builds its LLM request as a single user message with no system message before it:
messages = [
Message(
role="user",
content=[TextContent(text="ping")],
)
]
Placed at lines ~302–307 inside the validate-profile endpoint. The intent is a minimal 1-token completion to surface misconfiguration (bad model names, missing provider prefixes, bad base URLs, invalid API keys) before the profile is saved.
This violates the repo convention that every LLM request starts with a system message (see parent tracking issue #5144).
Proposed change
Prepend a minimal system message to the request, e.g.:
messages = [
Message(role="system", content=[TextContent(text="You are a connectivity-check helper. Reply with a single token.")]),
Message(role="user", content=[TextContent(text="ping")]),
]
The call remains a single-turn pre-flight check; only the message list shape changes. Keep it deliberately minimal so the probe stays cheap.
Parent issue: #5144
This issue was created by an AI agent (OpenHands) on behalf of juanmichelini.
Contributor guide
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
Open openhands-agent-server/openhands/agent_server/profiles_router.py around lines 302–307 and inspect the validate-profile endpoint's messages list. Confirm the pre-flight request remains single-turn, with a minimal system message before the existing user ping. Done means the request follows the repository convention while preserving the connectivity check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 85/100