Skip to content

Cache 1Password resolutions and unblock the op spawn - #1860

Merged
RhysSullivan merged 1 commit into
mainfrom
onepassword-latency
Aug 30, 2026
Merged

Cache 1Password resolutions and unblock the op spawn#1860
RhysSullivan merged 1 commit into
mainfrom
onepassword-latency

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

The executor resolves a connection's credential on every tool call. For 1Password-backed connections each resolution shelled out to op — roughly a second per call under desktop-app auth — so every tool call paid that on top of the real API latency. The spawn was also synchronous with no timeout, so one stuck op (for example waiting on an approval prompt) froze the whole local server for every other request.

Scoped to the 1Password plugin; other credential providers are unchanged.

  • Successful resolutions are served from memory for a short TTL (default 60s, secretCacheTtlMs). The cache keys by a config fingerprint, so editing or removing an account drops every cached secret at once. Not-found, ambiguity, and failures are never retained. Concurrent resolutions of one ref share one backend read even at TTL 0.
  • op now runs as an async spawn with a hard deadline (the existing timeoutMs), replacing the sync op-js backend. Auth travels per spawn: service-account token via child env, desktop account via --account. This also removes op-js's process-global token state (previously worked around in Clear the 1Password service-account token from the op-js global after each call #1574).
  • Services are memoized per auth identity, so the SDK fallback reuses one authenticated client.

Measured on a local instance calling a loopback API (1ms direct), identical tool call, only the secret's provider differing:

before after
file-provider call 4–8ms 5–12ms
1Password call 840–1680ms every call first 0.7–3s, then 5–12ms
/api/health during a 1Password resolve 546ms ~1ms

Unit tests cover the cache TTL/expiry/invalidation semantics and the new CLI backend (auth routing, timeout mapping, token redaction, SDK fallback).

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing e3805a6 Commit Preview URL

Branch Preview URL
Aug 29 2026, 11:51 PM

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud e3805a6 Aug 29 2026, 11:52 PM

@pkg-pr-new

pkg-pr-new Bot commented Aug 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1860

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1860

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1860

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1860

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1860

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1860

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1860

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1860

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1860

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1860

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1860

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1860

executor

npm i https://pkg.pr.new/executor@1860

commit: e3805a6

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 30, 2026 00:00
@RhysSullivan
RhysSullivan merged commit 2cad774 into main Aug 30, 2026
78 of 80 checks passed
@RhysSullivan RhysSullivan mentioned this pull request Aug 30, 2026
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