Repository navigation
Move the five OpenRouter workflows to Agent Router - #426
Merged
Merged
Conversation
Authenticate with a Google ID token from google-github-actions/auth, point the Claude engine at llm.idea.elastichosting.ai/anthropic and the Codex engine at llm.idea.elastichosting.ai/v1, and drop the OpenRouter keys, headers and base URLs. This assumes the Workload Identity pool, the allowlisted service account and the 5.5 models exist. Not tested. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
theletterf
force-pushed
the
feat/move-workflows-to-agent-router
branch
from
October 21, 2026 08:03
115fa32 to
73db17d
Compare
The Workload Identity provider and the service account exist in elastic/centralized-it-infra#1636. Both identifiers are public and the same for every caller, so the workflows use them as fallbacks and callers need no repository variables. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
gh-aw validates the engine key in the activation job, where the auth step does not exist, so the key needs a fallback literal there. The 5.5 Claude models are not onboarded yet, so use claude-haiku-4-5 and claude-sonnet-5 for now. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The AWF sidecar sends the Anthropic key in x-api-key by default and the gateway answers 401 Jwt is missing. AWF_ANTHROPIC_AUTH_HEADER renames the header, and the key value carries the Bearer scheme because the sidecar adds no prefix. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
The platform team onboarded claude-haiku-5-5 and claude-sonnet-5-5. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add an Agent Router section to DEVELOPING.md: how the auth step works, the engine settings, the models, how to add a repo, the shared rate limit, usage data, troubleshooting and sandbox testing. Update the index and per-workflow READMEs. Related to elastic/docs-eng-team#1056 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
akira28
approved these changes
Oct 26, 2026
This was referenced Oct 26, 2026
alexandra5000
pushed a commit
to alexandra5000/docs-content
that referenced
this pull request
Oct 26, 2026
## Summary IT is moving our docs agentic workflows from OpenRouter to Agent Router, and the new versions of the reusable workflows in `elastic/docs-actions` (elastic/docs-actions#426, still a draft) reach the gateway with a Google ID token. That token comes from the job's GitHub OIDC token, and GitHub only issues one to a job that has `id-token: write`. A reusable workflow cannot get more permissions than the calling job grants. So once `v1` moves to the new versions, a caller without this permission would fail at startup, even for runs that would not need it. I checked all the callers, and none of the three docs repos grant it today. This PR adds `id-token: write` next to `copilot-requests: write` in the callers of the five workflows that use Agent Router: - `docs-triage.yml`, `docs-auto-triage.yml`, `docs-scope.yml` and `docs-project-metadata.yml` (workflow-level permissions) - `docs-ai-menu.yml` (the `run-docs-issue-scope` job) - `docs-pr-ai-menu.yml` (the `run-docs-review` job) It is safe to merge now. The current `v1` workflows do not use the permission, so nothing changes until the release. The permission only lets a job ask for a token that describes itself. Google decides what that token can do, and IT's identity pool only accepts tokens from `gh-aw-*` workflows in `elastic/docs-actions`, from the repos on the service account's list (elastic/centralized-it-infra#1636). Where a file keeps its permissions at the workflow level, the new line sits in that block and covers every job that inherits it. I only added it to the jobs or blocks that call the reusable workflow. Related to elastic/docs-eng-team#1056 ## Generative AI disclosure 1. Did you use a generative AI (GenAI) tool to assist in creating this contribution? - [x] Yes - [ ] No Tool(s) and model(s) used: Claude Code (Claude Sonnet 5.5) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Sonnet 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves the five OpenRouter workflows to Agent Router. It is a draft, and it is an alternative to #424, which moves the same five to Copilot as a fallback. Both rewrite the same engine blocks, so whichever lands second needs a rebase and a recompile.
IT built the identity and the allowlist in elastic/centralized-it-infra#1636. I have tested most of this in
elastic/docs-actions-sandbox. The rate limit is what stops it from working in real use.What changes
In
gh-aw-issue-triage,gh-aw-issue-auto-triage,gh-aw-issue-scope,gh-aw-project-metadataandgh-aw-docs-review:google-github-actions/authand mints a Google ID token forhttps://llm.idea.elastichosting.aiwith the service account's email. The token goes to the engine as its key. The provider and the service account are public, so the workflows carry them as defaults, and callers need no repository variables.ANTHROPIC_BASE_URL=https://llm.idea.elastichosting.ai/anthropic. The AWF sidecar sends the Anthropic key inx-api-key, and the gateway only readsAuthorization: Bearer, so the workflows setAWF_ANTHROPIC_AUTH_HEADER=Authorizationand the key value starts withBearer.OPENAI_BASE_URLpointing at/v1. The sidecar sends Bearer natively.claude-haiku-5-5,claude-sonnet-5-5andgpt-5.6-luna.id-token: write, and the network allowlists swapopenrouter.aifor the gateway host.ANTHROPIC_API_KEYorOPENROUTER_API_KEYkeep working, because the workflows still declare those secrets as optional and unused.DEVELOPING.md(how the auth works, the engine settings, how to add a repo, the shared limit, troubleshooting, sandbox testing), the index README, and the per-workflow READMEs and examples.Sandbox results
claude-sonnet-5-5claude-haiku-5-5claude-haiku-5-5429gpt-5.6-luna429on Oct 22gpt-5.6-lunadocs-content-internalwith its ownADD_TO_BOARD_TOKEN(four requests, no429)Everything works end to end. The gateway first capped our account at 1,000,000 tokens per hour and counted cached tokens: one run of each of four workflows used about 1,049,000 tokens in ten minutes, and the rest got
429. IT removed the cap in elastic/centralized-it-infra#1663. After that, six sandbox runs counted about 1.9M tokens in one hour with no429.What blocks merging
id-token: write. oblt-aw already has it. For the three docs repos, I opened Grant id-token: write to the agentic workflow callers docs-content#8991, elastic/docs-content-internal#2075 and elastic/docs-eng-team#1121. They are safe to merge now and must merge before the release movesv1.Other things to know
copilot-requests: write, and detection spends Copilot allowance.AWF_ANTHROPIC_AUTH_HEADERsetting depends on AWF. If AWF changes how it sends the Anthropic key, the Claude workflows would fail with401 Jwt is missing.v1.Related to elastic/docs-eng-team#1056
🤖 Generated with Claude Code