Skip to content

fix: improve Hermes adapter reliability on Windows#206

Open
patkaryash wants to merge 1 commit into
OpenScanAI:masterfrom
patkaryash:feat/hermes-adapter-windows-reliability
Open

fix: improve Hermes adapter reliability on Windows#206
patkaryash wants to merge 1 commit into
OpenScanAI:masterfrom
patkaryash:feat/hermes-adapter-windows-reliability

Conversation

@patkaryash

Copy link
Copy Markdown

Summary

This PR improves the reliability of the Hermes adapter and plugin loading on Windows.

The changes ensure Hermes receives the execution context required by Paperclip, authenticates API requests correctly, resolves the correct project workspace, and avoids Windows-specific failures when loading JavaScript plugin workers.

##Thinking Path
-Paperclip executes AI agents through pluggable adapters.
-The Hermes adapter is responsible for translating Paperclip execution context into a Hermes run.
-Several runtime assumptions prevented reliable execution on Windows, including workspace resolution, authentication propagation, and plugin loading.
-These issues caused failed executions, incorrect working directories, and plugin startup failures.
-This PR hardens the adapter and plugin loader without changing the user-facing workflow.
-The result is more reliable Hermes execution across local Windows environments.

##What Changed
-Added a patch for hermes-paperclip-adapter@0.2.0.
-Propagated the Paperclip agent token as PAPERCLIP_API_KEY.
-Updated the adapter prompt to use authenticated Paperclip API requests.
-Improved execution context compatibility by merging runtime context with adapter configuration.
-Resolved working directories using Paperclip workspace realizations instead of relying only on configured paths.
-Normalized structured environment variable values before launching Hermes.
-Started each issue in a fresh Hermes session by default instead of automatically resuming previous sessions.
-Updated the plugin loader so the tsx loader is only applied to TypeScript worker entrypoints. JavaScript workers now execute natively, avoiding Windows ESM loader failures.
-Added the required pnpm patch configuration and lockfile entries for the patched adapter.

##Verification
-Verified Hermes launches using the correct project workspace.
-Verified authenticated Paperclip API requests using the injected agent token.
-Verified JavaScript plugin workers start without the Windows tsx ESM loader failure.
-Verified the adapter patch is applied correctly through pnpm.
-Confirmed the PR contains only the intended Hermes adapter and plugin loader changes.

##Risks
-Low risk.
-The adapter patch targets hermes-paperclip-adapter@0.2.0; future upstream releases may require regenerating the patch.
-The plugin loader change only affects how worker entrypoints are launched and should not affect runtime behavior for existing TypeScript plugins.

##Model Used
-Hermes CLI (Kimi Coding) for implementation assistance.
-ChatGPT GPT-5.5 for design review, change isolation, and PR review.

- Patch hermes-paperclip-adapter@0.2.0 for Paperclip auth and workspace resolution
- Add Authorization header guidance and propagate PAPERCLIP_API_KEY from ctx.authToken
- Resolve cwd from paperclipWorkspace realizations
- Ignore persisted sessions by default for fresh issue conversations
- Unwrap structured env values
- Only apply tsx loader to TS plugin worker entrypoints to avoid tsx Windows ESM bug
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.

1 participant