feat(framework): Add Open Responses compatible /responses endpoint to Runtime API - #7941
feat(framework): Add Open Responses compatible /responses endpoint to Runtime API#7941charlesbvll wants to merge 58 commits into
/responses endpoint to Runtime API#7941Conversation
Co-authored-by: Heng Pan <pan@flower.ai>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
# Conflicts: # framework/py/flwr/common/logger.py
# Conflicts: # framework/py/flwr/simulation/app.py # framework/py/flwr/simulation/simulationio_connection.py # framework/py/flwr/supercore/cli/flower_superexec.py # framework/py/flwr/supercore/task_process/agent/run_agentapp.py # framework/py/flwr/supercore/task_process/connector/run_connector.py # framework/py/flwr/supercore/task_process/model/run_model.py # framework/py/flwr/superlink/runtime/run_serverapp.py # framework/py/flwr/supernode/runtime/run_clientapp.py
# Conflicts: # framework/py/flwr/superlink/cli/flower_superlink.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1387d0c882
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1efe8c45bd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7182df9e7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 533818a120
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0bfa19d24d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if certificates is None: | ||
| return None | ||
|
|
||
| # OpenAI/httpx reads custom CAs from SSL_CERT_FILE, which requires a path. |
There was a problem hiding this comment.
@panh99 I'm not sure about this bit of code it seems different to the certificates that we have in the codebase. Can you check this?
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5e972c14c5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c061a6a06c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d5e28e3ed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -0,0 +1,437 @@ | |||
| # Copyright 2026 Flower Labs GmbH. All Rights Reserved. | |||
There was a problem hiding this comment.
Can we unify the runtime/responses and agent/session.py? Right now we have the duplication
RuntimeAgentResponses.create()
→ CreateTask
→ PushTaskMessage
→ poll PullTaskMessage
POST /v1/runtime/responses
→ CreateTask
→ store_task_message
→ poll LinkState
The CreateTask > Push/StoreTaskMessage > Poll can be unified.
danielnugraha
left a comment
There was a problem hiding this comment.
Can we split this PR to make it more manageable?
- proto and corestate changes
- create a shared file that both POST /v1/runtime/responses and RuntimeAgentResponses.create calls
- POST /v1/runtime/responses implementation
New Flow
Decisions made
POST /v1/runtime/responsesthrough a regular FastAPI JSON/SSE router because the existing Runtime router usesProtobufRouteAuthorization: Bearer <task-token>so standard Open Responses-compatible SDKs can call the endpoint directlyflwr-modeltask and sending it the existingModelRequestModelRequestmodelinputstreamtoolstool_choicereasoningprevious_response_idinstructionsmax_output_tokensmetadatatextreply_to_message_idSTOPPEDwhen the request times out or the client disconnectsFLWR_RUNTIME_BASE_URLandFLWR_RUNTIME_API_KEYbefore loading the AgentAppagent.responses.create(...)path unchangedOpen questions
STOPPEDenough on disconnect, or should we also add executor-level cancellation to terminate an in-flight provider request immediatelyagent.responses.create(...)eventually become a wrapper around this endpoint or remain on its current lower-level Runtime path -> We leave it unchanged for nowDeps
RuntimeAPItoHTTPfromgRPC#7936 and should be reconciled with its final merged form