Skip to content

fix(linear): remove Bearer prefix from API key auth + fix biome config#1112

Merged
zbigniewsobiecki merged 2 commits intodevfrom
fix/linear-api-key-auth
Apr 15, 2026
Merged

fix(linear): remove Bearer prefix from API key auth + fix biome config#1112
zbigniewsobiecki merged 2 commits intodevfrom
fix/linear-api-key-auth

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Root cause: linearGraphQL() was sending Authorization: Bearer <api_key> but Linear's API requires a bare Authorization: <api_key> for personal API keys (lin_api_*). Bearer is only for OAuth tokens. This broke every outbound Linear API call — verifying credentials, fetching teams, creating issues, etc.
  • Fix: Drop the Bearer prefix in src/linear/client.ts
  • Also: Add logger.error in wrapIntegrationCall so integration failures show up in server logs instead of being silently swallowed
  • Also: Add getMe unit tests (the method that was failing in the wizard)
  • Biome config fix: biome.json was referencing schema 2.4.10 but installed biome is 1.9.4 — causing the entire linter to exit with config errors on every commit. Fixed the schema ref, renamed assistorganizeImports and files.includesfiles.ignore to match 1.9.x API. Once the config was fixed, ran biome check --write to apply all previously-blocked import-sort and style fixes across the codebase. Added noDelete: off override for src/ and tests/delete process.env.X is semantically required (assigning undefined coerces to the string "undefined" in process.env).

Test plan

  • All 7553 unit tests pass locally
  • npm run lint passes clean (0 errors, 0 warnings)
  • npm run typecheck passes clean
  • Pre-commit and pre-push hooks pass
  • Linear wizard: enter lin_api_* key → click Verify → succeeds and shows username
  • CI passes on GitHub

🤖 Generated with Claude Code

zbigniewsobiecki and others added 2 commits April 15, 2026 15:54
…e config

**Bug fix:**
Linear personal API keys (lin_api_*) must be sent as bare Authorization
tokens — not Bearer tokens. Bearer is for OAuth access tokens only.
Every outbound Linear API call (getMe, getTeams, createIssue, etc.) was
broken for any project using a personal key.

Reproducer: curl -H "Authorization: Bearer lin_api_..." returned
"Remove the Bearer prefix from the Authorization header."

**Also included:**
- Add logger.error in wrapIntegrationCall so integration failures are
  visible in server logs (previously swallowed silently)
- Add getMe unit tests (the method that was failing in the wizard)
- Fix biome.json: schema ref was 2.4.10 but installed biome is 1.9.4;
  also renamed assist→organizeImports, includes→ignore (1.9.x keys)
- Run biome check --write to apply all import-sort and style fixes
  across the entire codebase (pre-existing issues, now unblocked)
- Add biome override to keep noDelete off for src/ and tests/ —
  delete process.env.X is semantically required (= undefined coerces
  to the string "undefined" in Node.js process.env)
- Remove stale biome-ignore comment in llm-call-list.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Local node_modules had biome 1.9.4 (stale from before #1075), so the
previous commit wrote a 1.9.4 config that broke CI (which installs fresh
2.4.10). After running npm install locally, re-wrote config for 2.4.10:
- Restore assist/files.includes keys (valid 2.x API)
- Keep noDelete: off override (src/ + tests/) — delete process.env.X
  is semantically required; = undefined coerces to "undefined" string
- Add noArrayIndexKey suppression back to llm-call-list (2.4.10 triggers
  the rule even for compound keys; suppression is warranted — read-only list)
- Re-apply biome 2.4.10 import sort across modified files

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit 1848b56 into dev Apr 15, 2026
8 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/linear-api-key-auth branch April 15, 2026 16:03
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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