feat(api-server): add client platform lane - #22561
Conversation
4f90bed to
9df30fa
Compare
9df30fa to
f7b7047
Compare
|
Thanks for the server-defined allow-list approach. Problems
Suggested changes
This is an automated hermes-sweeper review. |
|
Closing this in favor of the narrower mobile gateway contract work in #62858 and #63149. Current The replacement direction keeps platform identity and authority server-controlled: #62858 negotiates fail-closed WebSocket grants at the transport boundary, and #63149 layers revisioned conversation synchronization over that authorized connection. No code from this PR is being represented as merged. |
What does this PR do?
Adds API-server client platform lanes selected by
X-Platform/X-Hermes-Platform, so API clients can choose server-defined surfaces such asmobile_chatwithout being allowed to send arbitrary raw toolsets.This keeps ordinary mobile/API chat on a lightweight server-defined lane while preserving existing default
api_serverbehavior when no platform header is provided.Related Issue
N/A — follow-on implementation for mobile/API chat lane work.
Type of Change
Changes Made
gateway/platforms/api_server.py/v1/chat/completions,/v1/responses, and run/job paths.X-PlatformandX-Hermes-Platformas request selectors.X-Hermes-Platformin responses.hermes_cli/platforms.py,hermes_cli/tools_config.py,toolsets.py,cli-config.yaml.exampleapi_server,web, andmobile_chat.hermes-mobile-chatlane.mobile_chatfrom inheriting default plugin/MCP toolsets unless explicitly configured by the server.tests/gateway/test_api_server.py,tests/gateway/test_api_server_runs.py,tests/gateway/test_api_server_toolset.pyscripts/release.pyAPI Contract
Request headers:
X-Platform: api_server | web | mobile_chatX-Hermes-Platformis accepted as an alternate request headerResponse header:
X-Hermes-Platformechoes the selected API surfaceCompatibility/safety:
mobile_chatis no-tool by default and does not inherit default plugin/MCP toolsets unless explicitly configured.How to Test
Focused verification run after rebasing onto current
origin/main:Result:
290 passed, 163 warnings in 12.80sNotAppKeyWarningwarnings.py_compilepassed.git diff --checkpassed.scripts/check-windows-footguns.py --allpassed.Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
cli-config.yaml.examplebecause this adds config keysCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AFor New Skills
N/A — this PR does not add a skill.
Screenshots / Logs
Local verification evidence is included above.
Development note
I used Gerard, my Hermes Agent, as part of the development workflow for this PR: drafting the implementation, running focused verification, rebasing onto current
main, resolving the API-server conflict, and performing an additional review pass. The final diff and test results were reviewed by me before submission.