Skip to content

Granola: Fix auth fallback and add folder management (v2.1.3) - #27746

Merged
raycastbot merged 4 commits into
raycast:mainfrom
jlokos:jlokos/granola-v2.1.3
May 8, 2026
Merged

raycastbot merged 4 commits into
raycast:mainfrom
jlokos:jlokos/granola-v2.1.3

Conversation

@jlokos

@jlokos jlokos commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Description

This update fixes Granola authentication for users. It also adds folder management support for the Granola AI tools.

Authentication Fix

AI Tools and Folder Management

  • Added the manage-folders AI tool for creating, deleting, renaming, and organizing Granola folders
  • Improved folder, recipe, note content, and transcript API helpers
  • Updated AI instructions and evals for shared-folder queries so they resolve the folder first, then fetch meetings by folderId

Validation

  • npm run lint
  • npm run build
  • npx ray evals (100% | 16/16 Passed)

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: granola Issues related to the granola extension AI Extension platform: macOS platform: Windows OP is contributor The OP of the PR is a contributor of the extension labels May 8, 2026
@raycastbot

raycastbot commented May 8, 2026 •

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! 🎉

🔔 @RobErskine @jlokos you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

📋 Quick checkout commands
BRANCH="jlokos/granola-v2.1.3"
FORK_URL="https://github.com/jlokos/raycast-extensions.git"
EXTENSION_NAME="granola"
REPO_NAME="raycast-extensions"

git clone -n --depth=1 --filter=tree:0 -b $BRANCH $FORK_URL
cd $REPO_NAME
git sparse-checkout set --no-cone "extensions/$EXTENSION_NAME"
git checkout
cd "extensions/$EXTENSION_NAME"
npm install && npm run dev

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

@jlokos
jlokos marked this pull request as ready for review May 8, 2026 18:48
@greptile-apps

greptile-apps Bot commented May 8, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes Granola authentication for users whose sessions have migrated to stored-accounts.json (no longer exposing a plaintext WorkOS/Cognito token), and adds a new manage-folders AI tool for creating, deleting, and organizing folders.

  • Auth fix: getAccessToken.ts now falls back to stored-accounts.json when the Supabase config yields no usable token; accounts are sorted by savedAt and skipped gracefully on parse or expiry errors.
  • Folder management: New manage-folders tool wraps five granolaApi helpers (get, create, add-note, remove-note, delete) with Raycast tool confirmations; destructive actions use Action.Style.Destructive.
  • AI instruction updates: ai.yaml refines routing rules so shared-folder queries resolve the folder first via list-folders, then filter meetings by folderId.

Confidence Score: 5/5

The auth fallback and folder management changes are well-contained and safe to merge.

The new authentication fallback reads only from local files with full try/catch coverage and token-expiry checks. The folder management tool properly gates mutations behind confirmations. The only finding is a changelog date convention nit.

No files require special attention.

Important Files Changed

Filename Overview
extensions/granola/src/utils/getAccessToken.ts Adds a stored-accounts.json fallback auth path with proper try/catch guards, expiry checking, and account sorting by savedAt.
extensions/granola/src/tools/manage-folders.ts New AI tool exposing get/create/add-note/remove-note/delete actions on Granola document lists; confirmation always emits all three info fields regardless of action (already flagged in prior review thread).
extensions/granola/src/utils/granolaApi.ts Adds getDocumentList, createDocumentList, addDocumentToList, removeDocumentFromList, and deleteDocumentList helpers, all routed through the shared postToGranolaApi wrapper with consistent error handling.
extensions/granola/src/utils/fetchData.ts Adds getSharedDocuments, getIndividuallySharedDocuments, getDocumentsFromSharedFolders, and getDocumentsByIds to handle shared-document and shared-folder queries with deduplication and module-level ID caching.
extensions/granola/CHANGELOG.md New v2.1.3 entry documents auth fix and folder management; uses a hardcoded date instead of the required {PR_MERGE_DATE} placeholder.
extensions/granola/ai.yaml AI instruction updates clarify when to use list-folders vs list-meetings for shared-folder queries; logic is sound.
extensions/granola/package.json Bumps @raycast/api to ^1.104.16, registers the new manage-folders tool; all declared dependencies are used in source files.
extensions/granola/src/utils/folderHelpers.ts Refactored to use the getFolders API helper instead of cache logic; getFoldersWithCache is kept as a deprecated alias for backward compatibility.
extensions/granola/src/utils/granolaConfig.ts Adds getStoredAccountsPath() exposing the platform-specific path to stored-accounts.json; logic mirrors the existing getSupabaseConfigPath() pattern.
extensions/granola/src/tools/get-note-content.ts Added folderIds, folderNames, and duration fields to the output type; folder lookup and duration fetch are each wrapped in independent try/catch so failures don't block the core note content.
extensions/granola/src/tools/recipes.ts Minor refactor; recipe lookup and search logic is unchanged and correct.
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
extensions/granola/CHANGELOG.md:3
The changelog entry uses a hardcoded date instead of the `{PR_MERGE_DATE}` placeholder required by the Raycast changelog convention. The hardcoded date should be replaced with the placeholder so that the release date is populated automatically when the PR is merged.

```suggestion
## [2.1.3] - {PR_MERGE_DATE}
```

Reviews (3): Last reviewed commit: "Update CHANGELOG.md" | Re-trigger Greptile

Comment on lines +13 to +17
action: "get" | "create" | "add-note" | "remove-note" | "delete";
folderId?: string;
noteId?: string;
title?: string;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Rename action missing from Input type

The PR description explicitly lists "renaming" as a new capability of the manage-folders tool ("creating, deleting, renaming, and organizing"), but neither the Input union type nor the tool implementation includes a rename action, and there is no corresponding updateDocumentList / renameDocumentList function in granolaApi.ts. If folder renaming was intentionally deferred, the PR description is misleading and should be updated accordingly.

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/granola/src/tools/manage-folders.ts
Line: 13-17

Comment:
**Rename action missing from `Input` type**

The PR description explicitly lists "renaming" as a new capability of the `manage-folders` tool ("creating, deleting, renaming, and organizing"), but neither the `Input` union type nor the tool implementation includes a `rename` action, and there is no corresponding `updateDocumentList` / `renameDocumentList` function in `granolaApi.ts`. If folder renaming was intentionally deferred, the PR description is misleading and should be updated accordingly.

How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +37 to +45
return {
style: input.action === "delete" ? Action.Style.Destructive : Action.Style.Regular,
message: `${actionLabels[input.action]} in Granola?`,
info: [
{ name: "Folder ID", value: input.folderId },
{ name: "Note ID", value: input.noteId },
{ name: "Title", value: input.title },
],
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Confirmation info leaks undefined for irrelevant fields

All three info items (folderId, noteId, title) are always included regardless of the selected action. For a create action, for example, folderId and noteId will both be undefined, which may render as blank or literal "undefined" text in the Raycast confirmation dialog. Consider filtering to only include fields that are relevant to the chosen action (e.g. show folderId only when it is required).

Prompt To Fix With AI
This is a comment left during a code review.
Path: extensions/granola/src/tools/manage-folders.ts
Line: 37-45

Comment:
**Confirmation info leaks `undefined` for irrelevant fields**

All three info items (`folderId`, `noteId`, `title`) are always included regardless of the selected action. For a `create` action, for example, `folderId` and `noteId` will both be `undefined`, which may render as blank or literal `"undefined"` text in the Raycast confirmation dialog. Consider filtering to only include fields that are relevant to the chosen action (e.g. show `folderId` only when it is required).

How can I resolve this? If you propose a fix, please make it concise.

@RobErskine

Copy link
Copy Markdown
Contributor

Thanks for jumping on this @jlokos. I'm good with this fix

@0xdhrv 0xdhrv self-assigned this May 8, 2026
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

@0xdhrv 0xdhrv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved ✅

@raycastbot
raycastbot merged commit 099d722 into raycast:main May 8, 2026
2 checks passed
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Extension extension fix / improvement Label for PRs with extension's fix improvements extension: granola Issues related to the granola extension OP is contributor The OP of the PR is a contributor of the extension platform: macOS platform: Windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Granola] ... [Granola] ... not showing me transcript when trying to export them

4 participants