fix(hermes): inject task-local Paperclip env into gateway runs - #10625
fix(hermes): inject task-local Paperclip env into gateway runs#10625thedelph wants to merge 2 commits into
Conversation
Greptile SummaryThe PR enables heartbeat-scoped JWTs for Hermes Gateway runs and injects a bounded Paperclip environment into each remote run.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| packages/adapters/hermes/src/gateway/index.ts | Declares heartbeat-scoped JWT support and documents the gateway environment and security contract. |
| packages/adapters/hermes/src/gateway/server/execute.ts | Constructs the task-local Paperclip environment, excludes template-provided environment values, and redacts the injected JWT. |
| packages/adapters/hermes/src/gateway/server/execute.test.ts | Verifies exact environment injection, template isolation, and JWT redaction from output and logs. |
| packages/adapters/hermes/src/index.test.ts | Updates the package-level capability assertion for local agent JWT support. |
| server/src/tests/adapter-registry.test.ts | Updates registry coverage for the Hermes Gateway JWT capability. |
| server/src/tests/adapter-routes.test.ts | Updates the public adapter-capability response expectation. |
Reviews (2): Last reviewed commit: "test(server): update Hermes gateway JWT ..." | Re-trigger Greptile
|
Companion Hermes runtime support is open at NousResearch/hermes-agent#81976. It accepts this PR’s bounded |
|
Hermes-side support for the bounded, request-scoped run environment is open at NousResearch/hermes-agent#81976. That PR accepts the |
|
Companion Hermes support is now available in NousResearch/hermes-agent#81976. It accepts the bounded |
|
Security review follow-up is pushed to the companion Hermes receiver at NousResearch/hermes-agent#81976. It now makes an empty scoped request authoritative over ambient PAPERCLIP_* values, excludes those values from reusable shell snapshots, adds run-local exact-value redaction, suppresses token-unsafe SSE deltas, and rejects malformed runtime values. Current focused Hermes verification: 205 passed plus Ruff, py_compile, and git diff checks. Rollout must be receiver-first: deploy Hermes #81976 before enabling this sender because an older gateway can ignore the environment field. |
Thinking Path
Linked Issues or Issue Description
What happened?
The built-in Hermes Gateway adapter set
supportsLocalAgentJwttofalse. The heartbeat service therefore did not createctx.authToken. The gateway run body also did not create anenvironmentobject. A Hermes worker started by the gateway had noPAPERCLIP_API_URL,PAPERCLIP_API_KEY, orPAPERCLIP_RUN_ID.Expected behavior
Each Hermes Gateway heartbeat must get a short-lived agent JWT. The created Hermes run must receive the Paperclip URL, JWT, run ID, agent ID, company ID, task ID, and wake reason. The adapter must not forward unrelated environment values from
payloadTemplate.Steps to reproduce
hermes_gatewayadapter.masterbefore this change.Paperclip version or commit
ee851fc36onmaster.Deployment mode
Self-hosted server.
Agent adapter(s) involved
Hermes.
What Changed
supportsLocalAgentJwt: true.payloadTemplate.environmentto prevent credential override and unrelated secret forwarding.Verification
pnpm --filter @paperclipai/hermes-paperclip-adapter test -- src/gateway/server/execute.test.ts src/index.test.ts(27 tests passed).pnpm --filter @paperclipai/hermes-paperclip-adapter typecheck(passed).pnpm --filter @paperclipai/server exec vitest run src/__tests__/adapter-registry.test.ts(14 tests passed).git diff --check(passed).eslintexecutable.Risks
payloadTemplate.environment. This closes an unsafe override path but can affect a configuration that depended on that undocumented field.Model Used
Checklist
Fixes: #/Closes #/Refs #OR (b) described the issue in-PR following the relevant issue template#NNN/github.com/paperclipai/paperclipURLs)docs/...,fix/...) and contains no internal Paperclip ticket id or instance-derived details