Skip to content

fix: recover stale sketchi sessions and refresh oauth#200

Merged
anand-testcompare merged 3 commits intomainfrom
fix/opencode-sketchi-auth-refresh
Apr 16, 2026
Merged

fix: recover stale sketchi sessions and refresh oauth#200
anand-testcompare merged 3 commits intomainfrom
fix/opencode-sketchi-auth-refresh

Conversation

@anand-testcompare
Copy link
Copy Markdown
Collaborator

@anand-testcompare anand-testcompare commented Apr 16, 2026

Summary

  • add a WorkOS refresh endpoint that returns rotated access and refresh tokens for Sketchi device auth
  • refresh stored Sketchi OAuth credentials inside the OpenCode plugin before tool calls and clear invalid grants
  • recover from stale cached Sketchi session continuity by retrying once without the cached session and surfacing clearer errors for explicit invalid session IDs
  • document the refresh route in OpenAPI and classify session-not-found transport failures as NOT_FOUND

Validation

  • bun x ultracite fix
  • bun run build
  • cd packages/backend && bun run test
  • cd apps/web && bun run test -- src/app/api/auth/refresh/route.test.ts src/lib/workos-device-auth.test.ts
  • cd packages/opencode-excalidraw && bun test src/index.test.ts src/lib/session-continuity.test.ts src/lib/sketchi-oauth.test.ts
  • cd packages/opencode-excalidraw && bun run typecheck
  • local tests/e2e opencode-web-continuity passed against http://localhost:3001 on 2026-04-16

Open with Devin

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sketchi-web Ready Ready Preview, Comment Apr 16, 2026 10:50am

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 16, 2026

Browserbase Replays

  • Session 388f1740-46d1-4be0-a2a1-7cb99cce0a03 (scenario: visual-sanity.ts): replay | debug
  • Session 3fb397dc-2648-44bd-bd55-6297f3ae358e (scenario: auth-gates.ts): replay | debug
  • Session c1b1a5d3-fb2f-4bc5-961f-e2f27023ebff (scenario: opencode-web-continuity.ts): replay | debug
  • Session 8fad071e-c1de-42af-a986-6c765801dbf9 (scenario: diagram-studio-happy-path.ts): replay | debug
  • Session e938b2c2-3915-40d7-8754-1b26b8582ed6 (scenario: diagram-studio-occ-conflict.ts): replay | debug

Workflow run: 24506206041

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@anand-testcompare anand-testcompare merged commit 8c2d89a into main Apr 16, 2026
10 checks passed
@anand-testcompare anand-testcompare deleted the fix/opencode-sketchi-auth-refresh branch April 16, 2026 19:02
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