Skip to content

docs(sdk): Add missing file-based agent features documentation#390

Merged
VascoSch92 merged 1 commit intomainfrom
docs/file-based-agents-missing-features
Mar 11, 2026
Merged

docs(sdk): Add missing file-based agent features documentation#390
VascoSch92 merged 1 commit intomainfrom
docs/file-based-agents-missing-features

Conversation

@VascoSch92
Copy link
Contributor

Summary

This PR adds documentation for file-based agent features that are implemented in the software-agent-sdk but were not previously documented.

Changes

Updated Frontmatter Fields Table

Added the following fields to the documentation table:

  • mcp_servers - MCP server configurations for external tools
  • hooks - Lifecycle hook configurations
  • permission_mode - Action confirmation control
  • profile_store_dir - Custom LLM profile directory

New "Advanced Features" Section

Added a comprehensive new section with detailed examples for:

  1. MCP Servers - Shows how to define inline MCP server configurations in agent markdown files, enabling agents to use external tools like mcp-server-fetch without any Python code.

  2. Hooks - Documents how to configure lifecycle hooks directly in agent files, including:

    • All hook event types (pre_tool_use, post_tool_use, user_prompt_submit, session_start, session_end, stop)
    • Matcher patterns (wildcard, exact match, regex)
    • Links to the main Hooks guide for more details
  3. Permission Mode - Explains the security feature for controlling action confirmations:

    • always_confirm - Requires approval for all actions
    • never_confirm - No approval needed
    • confirm_risky - Only confirm risky actions (with security analyzer)

Verification

These features were verified against the source code in software-agent-sdk:

  • openhands-sdk/openhands/sdk/subagent/schema.py - AgentDefinition class
  • openhands-sdk/openhands/sdk/hooks/config.py - HookConfig class
  • Tests in tests/sdk/subagent/test_subagent_schema.py

Related

Add documentation for features that are implemented in the SDK but
were not yet documented for file-based agents:

- mcp_servers: Inline MCP server configurations for external tools
- hooks: Lifecycle hooks (pre_tool_use, post_tool_use, etc.)
- permission_mode: Action confirmation control (always_confirm,
  never_confirm, confirm_risky)
- profile_store_dir: Custom LLM profile directory

Also added an 'Advanced Features' section with detailed examples
showing how to use each feature in agent Markdown files.

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

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Good taste - Accurate documentation for real features.

Verification Summary:
Cloned OpenHands/software-agent-sdk and verified all documented features against source code:

Field names - All four new fields (mcp_servers, hooks, permission_mode, profile_store_dir) exist in AgentDefinition schema
Hook event types - All six event types match HOOK_EVENT_FIELDS in source
Permission modes - All three modes (always_confirm, never_confirm, confirm_risky) match _VALID_PERMISSION_MODES
Examples - YAML formats match test fixtures in test_subagent_schema.py
Data types - Field types and descriptions match the schema

Why this is good:

  • Solves a real problem: Features existed in code but were undocumented
  • Simple and straightforward: Just fills documentation gaps
  • Accurate: Every claim verified against actual implementation
  • Well-structured: Examples are clear and follow existing patterns

Verdict: ✅ Worth merging - Fills legitimate documentation gaps with accurate information.

@VascoSch92 VascoSch92 marked this pull request as ready for review March 11, 2026 13:51
@VascoSch92 VascoSch92 requested a review from xingyaoww as a code owner March 11, 2026 13:51
Copy link
Contributor

@all-hands-bot all-hands-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Good taste - Accurate documentation for real features.

Verification Summary:
Cloned OpenHands/software-agent-sdk and verified all documented features against source code:

Field names - All four new fields (mcp_servers, hooks, permission_mode, profile_store_dir) exist in AgentDefinition schema
Hook event types - All six event types match HOOK_EVENT_FIELDS in source
Permission modes - All three modes (always_confirm, never_confirm, confirm_risky) match implementation
MCP format - Configuration structure matches source examples
Tests exist - All features have test coverage in tests/sdk/subagent/test_subagent_schema.py

Notable: The profile_store_dir table description ("when using a named model") is actually MORE accurate than the source code docstring - verified against usage in registry.py line 213-214 where it's only accessed when model != "inherit".

No hallucinations. No fantasy APIs. Documentation matches reality. Merge it.

Copy link
Contributor

@xingyaoww xingyaoww left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@VascoSch92 VascoSch92 merged commit ed86d33 into main Mar 11, 2026
10 checks passed
@VascoSch92 VascoSch92 deleted the docs/file-based-agents-missing-features branch March 11, 2026 18:18
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