-
Notifications
You must be signed in to change notification settings - Fork 477
feat(sdk): add flags support and x-agenta-flags OpenAPI extension for chat detection #3622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mmabrouk
wants to merge
5
commits into
main
Choose a base branch
from
feat/new-chat-interface
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+970
−29
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… chat detection
- Add flags parameter to legacy @ag.route/@ag.entrypoint decorators (serving.py)
- Emit x-agenta-flags on /run and /test OpenAPI operations
- Add flags parameter to new @ag.route decorator (routing.py) and propagate to auto_workflow()
- Add is_chat to WorkflowFlags model in SDK and API
- Update builtin chat service to set flags={"is_chat": True}
- Add design docs for chat-interface RFC
This enables custom workflows to explicitly declare is_chat: true, which the frontend can read from OpenAPI to determine chat UI mode.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
62b64bd to
a7d6257
Compare
junaway
reviewed
Feb 5, 2026
junaway
reviewed
Feb 5, 2026
junaway
reviewed
Feb 5, 2026
Ensure @ag.route(flags=...) applies even when decorating an existing workflow and emit flags under x-agenta.flags (keeping x-agenta-flags as a temporary alias).
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Emit chat flags only under x-agenta.flags to avoid duplicate vendor extensions and ensure frontend discovery reads the canonical namespace.
…date RFC docs - Fix RuntimeError in application.__init__: iterating over kwargs['references'] while deleting keys matching 'evaluator_*' caused dict size change during iteration. Now builds key list first via list comprehension. - Fix same bug in evaluator.__init__ for keys matching 'application_*'. - Update status.md with cross-PR tracking table and progress log. - Mark Phase 1 + 1b as done in plan.md definition of done.
mmabrouk
added a commit
that referenced
this pull request
Feb 9, 2026
The SDK (PR #3622) changed the OpenAPI vendor extension from a flat 'x-agenta-flags' key to a nested 'x-agenta: {flags: {...}}' structure. Update _get_openapi_chat_flag to read from the new nested path. Also removes unused imports (common, make_hash_id) caught by ruff.
mmabrouk
added a commit
that referenced
this pull request
Feb 9, 2026
The SDK (PR #3622) changed the OpenAPI vendor extension from a flat 'x-agenta-flags' key to a nested 'x-agenta: {flags: {...}}' structure. Update _get_openapi_chat_flag to read from the new nested path. Also removes unused imports (common, make_hash_id) caught by ruff.
mmabrouk
added a commit
that referenced
this pull request
Feb 9, 2026
Update all 4 frontend chat detection paths to prefer the explicit x-agenta.flags.is_chat flag from the SDK's OpenAPI extension, falling back to the existing messages-property heuristic for older apps. Detection paths updated: - genericTransformer/index.ts: detectChatVariantFromOpenAISchema() - appRevision/api/schema.ts: extractAllEndpointSchemas() - appRevision + legacyAppRevision runnableSetup.ts: isChatVariantAtomFamily (now reads pre-computed isChatVariant from schema state) - requestSchemaMeta.ts: hasMessages computation Stacked on PR #3622 (SDK flags support).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Phase 1 and Phase 1b of the Chat Interface RFC, enabling custom workflows to explicitly declare themselves as chat applications via a
flagsparameter.Changes
Legacy System (
serving.py):flags: Optional[Dict[str, Any]]parameter to@ag.route,@ag.entrypoint, andcreate_app()'sisolated_routex-agenta-flagson/runand/testOpenAPI operationsflags={"is_chat": True}New Workflow System (
routing.py):flags: Optional[dict]parameter to@ag.routeauto_workflow()so they flow to/inspectresponseModels:
is_chat: bool = FalsetoWorkflowFlagsin SDK (sdk/agenta/sdk/models/workflows.py)is_chat: bool = FalsetoWorkflowFlagsin API (api/oss/src/core/workflows/dtos.py)Design Docs:
docs/design/chat-interface-rfc/with research, plan, and statusUsage
OpenAPI Output
Testing
x-agenta-flags.is_chat: trueappears in/services/chat/openapi.jsonNext Steps (Phase 2)
Frontend changes to read
x-agenta-flags.is_chatfor chat detection (with heuristics fallback).