Skip to content

Conversation

@xingyaoww
Copy link
Collaborator

@xingyaoww xingyaoww commented Nov 21, 2025

Summary

This PR adds comprehensive comments to the 03_activate_skill.py example to help users understand all available options for customizing system prompts.

Changes

  • Added detailed comments explaining three ways to customize prompts:

    1. Skills: Inject instructions (always-active or keyword-triggered)
    2. system_message_suffix: Append text to the system prompt via AgentContext
    3. user_message_suffix: Append text to each user message via AgentContext
  • Added code example showing how to use Agent's system_prompt_filename parameter for complete control:

    agent = Agent(
        llm=llm,
        tools=tools,
        system_prompt_filename="/path/to/custom_prompt.j2",
        system_prompt_kwargs={"cli_mode": True, "repo": "my-project"},
    )
  • Documented system_prompt_kwargs for passing variables to custom Jinja2 templates

  • Added link to comprehensive documentation: https://docs.openhands.dev/sdk/guides/skill#customizing-system-prompts

  • Clarified that trigger=None means always-active (repo skill)

Related

Testing

Existing example still runs correctly with the added comments.

@xingyaoww can click here to continue refining the PR


Agent Server images for this PR

GHCR package: https://github.com/OpenHands/agent-sdk/pkgs/container/agent-server

Variants & Base Images

Variant Architectures Base Image Docs / Tags
java amd64, arm64 eclipse-temurin:17-jdk Link
python amd64, arm64 nikolaik/python-nodejs:python3.12-nodejs22 Link
golang amd64, arm64 golang:1.21-bookworm Link

Pull (multi-arch manifest)

# Each variant is a multi-arch manifest supporting both amd64 and arm64
docker pull ghcr.io/openhands/agent-server:896165f-python

Run

docker run -it --rm \
  -p 8000:8000 \
  --name agent-server-896165f-python \
  ghcr.io/openhands/agent-server:896165f-python

All tags pushed for this build

ghcr.io/openhands/agent-server:896165f-golang-amd64
ghcr.io/openhands/agent-server:896165f-golang_tag_1.21-bookworm-amd64
ghcr.io/openhands/agent-server:896165f-golang-arm64
ghcr.io/openhands/agent-server:896165f-golang_tag_1.21-bookworm-arm64
ghcr.io/openhands/agent-server:896165f-java-amd64
ghcr.io/openhands/agent-server:896165f-eclipse-temurin_tag_17-jdk-amd64
ghcr.io/openhands/agent-server:896165f-java-arm64
ghcr.io/openhands/agent-server:896165f-eclipse-temurin_tag_17-jdk-arm64
ghcr.io/openhands/agent-server:896165f-python-amd64
ghcr.io/openhands/agent-server:896165f-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-amd64
ghcr.io/openhands/agent-server:896165f-python-arm64
ghcr.io/openhands/agent-server:896165f-nikolaik_s_python-nodejs_tag_python3.12-nodejs22-arm64
ghcr.io/openhands/agent-server:896165f-golang
ghcr.io/openhands/agent-server:896165f-java
ghcr.io/openhands/agent-server:896165f-python

About Multi-Architecture Support

  • Each variant tag (e.g., 896165f-python) is a multi-arch manifest supporting both amd64 and arm64
  • Docker automatically pulls the correct architecture for your platform
  • Individual architecture tags (e.g., 896165f-python-amd64) are also available if needed

- Document AgentContext's system_message_suffix and user_message_suffix
- Add example of using Agent's system_prompt_filename for custom templates
- Explain system_prompt_kwargs for passing variables to templates
- Link to comprehensive documentation at docs.openhands.dev
- Clarify that trigger=None means always-active (repo skill)
@openhands-ai
Copy link

openhands-ai bot commented Nov 21, 2025

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Pre-commit checks

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #1220 at branch `add-system-prompt-customization-comments`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

@xingyaoww
Copy link
Collaborator Author

@OpenHands please fix the failing actions on PR #1220 at branch add-system-prompt-customization-comments

@xingyaoww xingyaoww marked this pull request as ready for review November 21, 2025 19:59
@openhands-ai
Copy link

openhands-ai bot commented Nov 21, 2025

I'm on it! xingyaoww can track my progress at all-hands.dev

Remove inline comments that caused line length to exceed 88 characters

Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Nov 21, 2025

Summary

I've successfully fixed the failing pre-commit checks on PR #1220 (branch add-system-prompt-customization-comments).

Issue Identified

The Ruff linter was failing because line 58 exceeded the 88-character limit (it was 92 characters long).

Changes Made

  • Removed inline comments from two lines in the code example within the comment block
  • Lines 57-58: Removed # absolute or relative path and # template variables inline comments
  • These comments were causing the lines to exceed the character limit

Verification

✅ All pre-commit checks now pass:

  • Ruff format: Passed
  • Ruff lint: Passed
  • PEP8 style check: Passed
  • Type check with pyright: Passed

The fix has been committed and pushed to the add-system-prompt-customization-comments branch. The GitHub Actions should now pass successfully.

View full conversation

@xingyaoww xingyaoww merged commit 8b7e0be into main Nov 24, 2025
22 checks passed
@xingyaoww xingyaoww deleted the add-system-prompt-customization-comments branch November 24, 2025 19:27
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.

4 participants