Skip to content

Document custom actions implementation details#251

Open
snopoke wants to merge 2 commits intomainfrom
docs/custom-actions-update
Open

Document custom actions implementation details#251
snopoke wants to merge 2 commits intomainfrom
docs/custom-actions-update

Conversation

@snopoke
Copy link
Copy Markdown
Contributor

@snopoke snopoke commented Jan 22, 2026

Summary

This PR expands the custom actions documentation based on a thorough review of the implementation in apps/custom_actions.

Changes

Updated docs/concepts/custom_actions.md with:

  • How it works: OpenAPI schema parsing, validation on save, operation extraction
  • Versioning behavior: How CustomActionOperation schemas are snapshotted when experiments/assistants are versioned
  • Database constraints: Unique holder constraints, operation ID uniqueness per action
  • Tool conversion: How operations become LLM tools (via FunctionDef.build_tool)
  • API response handling: Text responses and file download behavior (Content-Disposition)
  • Authentication: AuthProvider integration, fallback to anonymous auth
  • Limitations: HTTPS-only, validation requirements, testing tips

Background

The existing docs were brief and missing important implementation details that users and developers need to understand how custom actions work, especially around versioning, constraints, and the OpenAPI parsing behavior.

Review Notes

  • Derived from code review of apps/custom_actions (models, schema_utils, forms, views)
  • Focused on behavior visible in the implementation
  • Can add follow-up how-to guides or examples if needed

cc: @skelly (requested via research task)

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Jan 22, 2026

Documentation Review Summary

Thank you for this comprehensive expansion of the Custom Actions documentation! The added implementation details about versioning, constraints, and OpenAPI parsing are valuable for both users and developers.

Required Changes (4 issues)

  1. Fix broken link (line 20): See: docs/team/authentication_providers.md should use proper markdown link syntax
  2. Restore external link (line 5): The OpenAI GPT Actions reference link was removed - consider keeping it for context
  3. Clarify terminology (lines 34, 50): "working version" needs definition or should align with "unreleased version" from versioning docs
  4. Expand schema validation (line 30): Add actionable guidance on what makes schemas invalid

Notable Suggestions

  • Consider restructuring for progressive disclosure (user-focused sections first, then technical details)
  • Add a minimal OpenAPI schema example for practical guidance
  • Cross-reference the versioning documentation
  • Clarify file download behavior ("handled accordingly" is vague)

I'll post inline comments on the specific lines. Once the required changes are addressed, this will be a significant improvement to the docs.


Review powered by Claude Code documentation-pr-reviewer agent

Comment thread docs/concepts/custom_actions.md Outdated
If the external API requires authentication, create an Authentication Provider in Team Settings and attach it to the Custom Action. If no auth provider is configured the action will use an anonymous auth service.

[auth_providers]: team/authentication_providers.md
See: docs/team/authentication_providers.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix broken link format (Required)

This link format won't work in MkDocs. Use proper relative markdown link syntax:

Suggested change
See: docs/team/authentication_providers.md
See [Authentication Providers](team/authentication_providers.md) for details on creating and configuring authentication.

Comment thread docs/concepts/custom_actions.md Outdated
Custom Actions enable bots to communicate with external services via HTTP API calls. This feature allows you to extend the functionality of your bot by integrating it with other services.

This feature is analogous to the OpenAI's [GPT Actions](https://platform.openai.com/docs/actions/introduction) feature.
This feature is analogous to the OpenAI's GPT Actions feature.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider restoring the external link (Suggestion)

The removed hyperlink to OpenAI's GPT Actions documentation provided helpful context. Consider keeping it:

Suggested change
This feature is analogous to the OpenAI's GPT Actions feature.
This feature is analogous to the OpenAI's [GPT Actions](https://platform.openai.com/docs/actions/introduction) feature.

External references help users understand the broader context.

Comment thread docs/concepts/custom_actions.md Outdated
Comment on lines +26 to +28
### API Schema (OpenAPI)

Provide a JSON or YAML OpenAPI schema that describes the API. The platform parses the schema on save and extracts operations. The schema must be a valid OpenAPI document (FastAPI's /openapi.json works).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add actionable guidance (Required)

Expand this to help users understand what causes validation failures:

Suggested change
### API Schema (OpenAPI)
Provide a JSON or YAML OpenAPI schema that describes the API. The platform parses the schema on save and extracts operations. The schema must be a valid OpenAPI document (FastAPI's /openapi.json works).
Provide a JSON or YAML OpenAPI schema that describes the API. The platform parses the schema on save and extracts operations. The schema must be a valid OpenAPI document (FastAPI's /openapi.json works).
If the schema cannot be parsed, the save will fail with a validation error. Common issues include invalid JSON/YAML syntax, missing required OpenAPI fields (e.g., `openapi` version, `paths`, `info`), or non-standard operation definitions. Check the error message displayed in the UI for specific validation failures.

Comment thread docs/concepts/custom_actions.md Outdated

## How Custom Actions work (detailed)

- The CustomAction model stores the server_url, api_schema, optional auth_provider, and derived operations. When a Custom Action is saved the OpenAPI schema is parsed and the available operations are computed and stored in-memory for the working version.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clarify "working version" terminology (Required)

The versioning documentation uses "unreleased version" consistently. Either define "working version" here or align with existing terminology for consistency.

Suggestion: Replace "working version" with "unreleased version" throughout (here and on line 50).

Comment thread docs/concepts/custom_actions.md Outdated

- When running, each CustomActionOperation is converted into a "tool" that is passed to the LLM agent. The tool knows how to build and send the HTTP request for that operation (see apps.chat.agent.openapi_tool.FunctionDef.build_tool).

- API responses are returned to the LLM as text. If the remote response includes a Content-Disposition header indicating a file download, the file is downloaded and handled accordingly.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clarify file handling (Suggestion)

"handled accordingly" is vague. Be specific about what happens to downloaded files:

Suggested change
- API responses are returned to the LLM as text. If the remote response includes a Content-Disposition header indicating a file download, the file is downloaded and handled accordingly.
- API responses are returned to the LLM as text. If the remote response includes a Content-Disposition header indicating a file download, the file is downloaded and passed to the LLM as an attachment (depending on the LLM's file handling capabilities).

Or if files aren't fully supported, state that explicitly.

Comment thread docs/concepts/custom_actions.md Outdated

- API responses are returned to the LLM as text. If the remote response includes a Content-Disposition header indicating a file download, the file is downloaded and handled accordingly.

## Permissions, constraints, and usage notes
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Consider section rename (Suggestion)

This section doesn't actually cover "Permissions" - only constraints and limitations. Consider:

Suggested change
## Permissions, constraints, and usage notes
## Constraints and limitations

- Remove internal implementation details (models, database constraints)
- Focus on user-facing concepts and UI workflow
- Keep technical depth but explain from user's point of view
- Add troubleshooting and best practices sections
@lisa-jwayela
Copy link
Copy Markdown
Collaborator

@snopoke I will see if anything useful here to add to docs. Then we can close this out.

@lisa-jwayela lisa-jwayela self-assigned this Mar 20, 2026
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