-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Adding a handful of Get Current User actions #18774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Starting with a handful of the top apps
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughAdds new "Get Current User" actions for GitHub, Google Calendar, Google Drive, Google Sheets, Linear, Notion, and Slack that fetch authenticated user context and related data (often concurrently). Also bumps patch versions for the affected component packages. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Runner
participant Action as Get Current User Action
participant Provider as Provider API
Runner->>Action: run()
rect rgba(200,230,255,0.15)
note right of Action: perform parallel fetches where available
par Fetch auth
Action->>Provider: get authenticated user/context
and Fetch related resources
Action->>Provider: get orgs / teams / calendars / settings / colors / about / profile / team info
end
end
Provider-->>Action: responses
Action->>Action: assemble result, export $summary
Action-->>Runner: return { user, ...relatedData }
sequenceDiagram
autonumber
actor Runner
participant LinearAction as Linear Get Current User
participant LinearGQL as Linear GraphQL API
Runner->>LinearAction: run()
par Viewer
LinearAction->>LinearGQL: query viewer { ... }
and Organization
LinearAction->>LinearGQL: query organization { ... }
and Teams
LinearAction->>LinearGQL: query teams(first:N) { nodes, pageInfo }
and TeamMemberships
LinearAction->>LinearGQL: query teamMemberships(first:N) { nodes, pageInfo }
end
LinearGQL-->>LinearAction: datasets
LinearAction->>LinearAction: assemble response
LinearAction-->>Runner: return { user, organization, teams, teamMemberships }
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧬 Code graph analysis (1)components/slack/actions/get-current-user/get-current-user.mjs (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
♻️ Duplicate comments (2)
components/slack/actions/get-current-user/get-current-user.mjs (2)
35-43: Same issue: Rate limit errors are silently caught.This has the same inconsistency as the
usersInfocall above. Apply the same fix here.
45-52: Same issue: Rate limit errors are silently caught.This has the same inconsistency as the previous API calls. Apply the same fix here.
🧹 Nitpick comments (4)
components/google_drive/actions/get-current-user/get-current-user.mjs (1)
22-25: Consider extracting common user name derivation logic.This exact fallback chain for deriving
summaryNameis duplicated in the Google Sheets action. Since both Google Drive and Google Sheets use the Drive API'saboutendpoint with identical fields and logic, consider extracting this into a shared helper function to reduce duplication.For example, create a shared utility:
// common/google-user-utils.mjs export function deriveUserDisplayName(about) { return about?.user?.displayName || about?.user?.emailAddress || about?.user?.permissionId; }Then import and use in both actions:
+import { deriveUserDisplayName } from "../../common/google-user-utils.mjs"; + const ABOUT_FIELDS = "user,storageQuota"; export default { // ... async run({ $ }) { const about = await this.googleDrive.getAbout(ABOUT_FIELDS); - const summaryName = - about?.user?.displayName - || about?.user?.emailAddress - || about?.user?.permissionId; + const summaryName = deriveUserDisplayName(about); $.export("$summary", `Retrieved Google Drive user ${summaryName}`); return { about, }; }, };components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
22-25: Duplicate logic with Google Drive action.This summaryName derivation is identical to the Google Drive action. See the refactoring suggestion in the Google Drive review to extract this common logic into a shared utility.
components/notion/actions/get-current-user/get-current-user.mjs (1)
24-32: Consider simplifying the owner formatting logic.The IIFE on lines 26-31 adds complexity for what is essentially conditional string formatting. A simpler approach would improve readability.
Consider this alternative:
const displayName = response?.name || response?.bot?.workspace_name || response?.id; const ownerUser = response?.bot?.owner?.user; - const ownerName = ownerUser?.name || ownerUser?.id; - const ownerEmail = ownerUser?.person?.email; + + let ownerInfo = null; + if (ownerUser) { + const name = ownerUser.name || ownerUser.id; + const email = ownerUser.person?.email; + ownerInfo = email ? `owner ${name} (<${email}>)` : `owner ${name}`; + } + const summaryParts = [ response?.bot?.workspace_name && `workspace **${response.bot.workspace_name}**`, - (() => { - if (!ownerName && !ownerEmail) return null; - if (ownerName && ownerEmail) return `owner ${ownerName} (<${ownerEmail}>)`; - if (ownerName) return `owner ${ownerName}`; - return `owner <${ownerEmail}>`; - })(), + ownerInfo, ].filter(Boolean);components/slack/actions/get-current-user/get-current-user.mjs (1)
24-52: Consider concurrent API calls for better performance.The three independent API calls (
usersInfo,getUserProfile,getTeamInfo) execute sequentially, which increases total latency. Since each has graceful degradation, they can run concurrently.Apply this diff to make the calls concurrent:
- let userInfo; - try { - userInfo = await this.slack.usersInfo({ - user: userId, - include_locale: true, - throwRateLimitError: true, - }); - } catch (error) { - // Gracefully degrade if scope not available - } - - let userProfile; - try { - userProfile = await this.slack.getUserProfile({ - user: userId, - throwRateLimitError: true, - }); - } catch (error) { - // Gracefully degrade if scope not available - } - - let teamInfo; - try { - teamInfo = await this.slack.getTeamInfo({ - throwRateLimitError: true, - }); - } catch (error) { - // Gracefully degrade if scope not available - } + const [ + userInfoResult, + userProfileResult, + teamInfoResult, + ] = await Promise.allSettled([ + this.slack.usersInfo({ + user: userId, + include_locale: true, + throwRateLimitError: true, + }), + this.slack.getUserProfile({ + user: userId, + throwRateLimitError: true, + }), + this.slack.getTeamInfo({ + throwRateLimitError: true, + }), + ]); + + const userInfo = userInfoResult.status === 'fulfilled' ? userInfoResult.value : undefined; + const userProfile = userProfileResult.status === 'fulfilled' ? userProfileResult.value : undefined; + const teamInfo = teamInfoResult.status === 'fulfilled' ? teamInfoResult.value : undefined;This pattern aligns with the GitHub action implementation (see
components/github/actions/get-current-user/get-current-user.mjs) and reduces total execution time when multiple calls succeed.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (14)
components/github/actions/get-current-user/get-current-user.mjs(1 hunks)components/github/package.json(1 hunks)components/google_calendar/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_calendar/package.json(1 hunks)components/google_drive/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_drive/package.json(1 hunks)components/google_sheets/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_sheets/package.json(1 hunks)components/linear/actions/get-current-user/get-current-user.mjs(1 hunks)components/linear/package.json(1 hunks)components/notion/actions/get-current-user/get-current-user.mjs(1 hunks)components/notion/package.json(1 hunks)components/slack/actions/get-current-user/get-current-user.mjs(1 hunks)components/slack/package.json(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (6)
components/github/actions/get-current-user/get-current-user.mjs (2)
components/linear/actions/get-current-user/get-current-user.mjs (2)
user(64-90)teams(45-62)components/zoho_desk/zoho_desk.app.mjs (1)
organizations(14-15)
components/google_calendar/actions/get-current-user/get-current-user.mjs (3)
components/google_drive/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/slack/actions/get-current-user/get-current-user.mjs (1)
summaryName(56-60)
components/google_drive/actions/get-current-user/get-current-user.mjs (1)
components/google_sheets/actions/get-current-user/get-current-user.mjs (3)
ABOUT_FIELDS(3-3)about(20-20)summaryName(22-25)
components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
components/google_drive/actions/get-current-user/get-current-user.mjs (3)
ABOUT_FIELDS(3-3)about(20-20)summaryName(22-25)
components/slack/actions/get-current-user/get-current-user.mjs (5)
components/github/actions/get-current-user/get-current-user.mjs (1)
user(21-31)components/linear/actions/get-current-user/get-current-user.mjs (1)
user(64-90)components/google_calendar/actions/get-current-user/get-current-user.mjs (1)
summaryName(46-46)components/google_drive/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)
components/linear/actions/get-current-user/get-current-user.mjs (1)
components/github/actions/get-current-user/get-current-user.mjs (1)
user(21-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Publish TypeScript components
- GitHub Check: Verify TypeScript components
🔇 Additional comments (14)
components/notion/package.json (1)
3-3: LGTM!Standard patch version bump for the new action. No issues detected.
components/linear/package.json (1)
3-3: LGTM!Appropriate patch version increment. No issues detected.
components/github/package.json (1)
3-3: LGTM!Appropriate patch version increment. No issues detected.
components/google_sheets/package.json (1)
3-3: LGTM!Appropriate patch version increment. No issues detected.
components/google_drive/package.json (1)
3-3: LGTM!Appropriate patch version increment. No issues detected.
components/google_drive/actions/get-current-user/get-current-user.mjs (1)
5-31: Action structure looks good.The action metadata is clear and descriptive, and the run function follows a clean pattern: fetch data, derive summary, export, and return. The use of optional chaining provides safe access to potentially missing fields.
components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
5-31: Action structure looks good.The action follows the same clean pattern as the Google Drive action, with clear metadata and a straightforward run function.
components/notion/actions/get-current-user/get-current-user.mjs (1)
3-41: Action structure and metadata look good.The action follows a clear pattern, with comprehensive metadata and a run function that appropriately handles the Notion user response, including bot workspace ownership context.
components/slack/actions/get-current-user/get-current-user.mjs (6)
1-16: LGTM!The metadata, annotations, and props are well-structured. The comprehensive description clearly explains the action's purpose and use cases.
17-20: LGTM!The
authTestcall correctly lacks error handling, allowing authentication failures to propagate. This is appropriate since this is the foundational call that determines if the user is authenticated.
22-22: LGTM!The fallback pattern for extracting
userIdis appropriate and handles variations in theauthContextresponse.
54-60: LGTM!The defensive fallback pattern for
summaryNameis well-designed and consistent with similar implementations in Google Calendar, Google Drive, and Google Sheets actions.
62-65: LGTM!The summary export correctly uses the computed
summaryNamefallback chain.
67-99: LGTM!The return object structure is well-designed with comprehensive user and team fields. The conditional object inclusion pattern (
user && { ... }) appropriately handles cases where data is unavailable.
…pedream into danny/authed-user-actions
…pedream into danny/authed-user-actions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
components/slack/actions/get-current-user/get-current-user.mjs (1)
22-46: Consider adding minimal logging for error visibility.The graceful degradation pattern is appropriate for handling missing scopes, but silently catching all errors (network failures, API issues, invalid parameters) makes debugging difficult.
Apply this diff to add minimal logging without breaking the graceful degradation:
try { userInfo = await this.slack.usersInfo({ user: userId, include_locale: true, }); } catch (error) { - // Gracefully degrade if scope not available + console.warn(`Failed to fetch user info: ${error.message}`); } let userProfile; try { userProfile = await this.slack.getUserProfile({ user: userId, }); } catch (error) { - // Gracefully degrade if scope not available + console.warn(`Failed to fetch user profile: ${error.message}`); } let teamInfo; try { teamInfo = await this.slack.getTeamInfo(); } catch (error) { - // Gracefully degrade if scope not available + console.warn(`Failed to fetch team info: ${error.message}`); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/slack/actions/get-current-user/get-current-user.mjs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
components/slack/actions/get-current-user/get-current-user.mjs (4)
components/linear/actions/get-current-user/get-current-user.mjs (1)
user(64-90)components/google_calendar/actions/get-current-user/get-current-user.mjs (1)
summaryName(46-46)components/google_drive/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Publish TypeScript components
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
🔇 Additional comments (2)
components/slack/actions/get-current-user/get-current-user.mjs (2)
1-16: LGTM!The metadata and structure are well-defined. The comprehensive description is appropriate given the PR's goal of enabling LLMs to introspect authenticated user context.
48-59: LGTM!The summary computation uses a robust fallback chain, consistent with similar implementations in Google Calendar and other services in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (6)
components/linear/actions/get-current-user/get-current-user.mjs (2)
27-43: Consider adding error handling for API failures.The parallel data fetching improves performance, but there's no error handling if any of the API calls fail. Consider wrapping the operations in a try-catch block and providing meaningful error messages.
Apply this diff to add error handling:
async run({ $ }) { + try { const client = this.linearApp.client(); const viewer = await client.viewer; const [ organization, teamsConnection, teamMembershipsConnection, ] = await Promise.all([ viewer.organization, viewer.teams({ first: DEFAULT_CONNECTION_LIMIT, }), viewer.teamMemberships({ first: DEFAULT_CONNECTION_LIMIT, }), ]); + } catch (error) { + throw new Error(`Failed to fetch Linear user data: ${error.message}`); + }Note: You'll need to move the rest of the run method logic inside the try block and adjust the closing brace accordingly.
147-158: Return structure is well-designed.The response object provides comprehensive user context with proper pagination metadata. Consider making
DEFAULT_CONNECTION_LIMITconfigurable as a prop if users frequently need more than 50 teams or memberships, though this is optional for the initial implementation.components/google_calendar/actions/get-current-user/get-current-user.mjs (1)
49-56: Consider adding a default value forlocalefor consistency.The return object is well-structured. However,
calendarsandsettingsuse??to provide default empty arrays, whilelocalereturnsundefinedif not found. Adding a default (e.g.,nullor"") would make the handling more consistent and predictable for consumers.Apply this diff if you want to add a default value:
return { primaryCalendar, calendars: calendarList?.items ?? [], settings: settings?.items ?? [], timezone: timezoneSetting || primaryCalendar?.timeZone, - locale: localeSetting, + locale: localeSetting ?? null, colors, };components/github/actions/get-current-user/get-current-user.mjs (3)
3-4: Consider making these limits configurable props.While hardcoded limits keep the action simple for the LLM use case, exposing them as optional props (with these as defaults) would provide flexibility for users with many orgs/teams.
Example:
+ orgsLimit: { + type: "integer", + label: "Organizations Limit", + description: "Maximum number of organizations to return", + default: DEFAULT_ORGS_LIMIT, + optional: true, + }, + teamsLimit: { + type: "integer", + label: "Teams Limit", + description: "Maximum number of teams to return", + default: DEFAULT_TEAMS_LIMIT, + optional: true, + },Then use
this.orgsLimit ?? DEFAULT_ORGS_LIMITandthis.teamsLimit ?? DEFAULT_TEAMS_LIMITin the slicing operations.
9-9: Document the 20-item limits in the description.The description should mention that organizations and teams are limited to 20 items each for clarity.
Example addition to the description:
-description: "Gather a full snapshot of the authenticated GitHub actor, combining `/user`, `/user/orgs`, and `/user/teams`. Returns profile metadata (login, name, email, company, plan, creation timestamps) and trimmed lists of organizations and teams for quick role awareness. Helpful when you need to validate which user is calling the API, adapt behavior based on their org/team memberships, or provide LLMs with grounding before repository operations. [See the documentation](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).", +description: "Gather a full snapshot of the authenticated GitHub actor, combining `/user`, `/user/orgs`, and `/user/teams`. Returns profile metadata (login, name, email, company, plan, creation timestamps) and trimmed lists of organizations (up to 20) and teams (up to 20) for quick role awareness. Helpful when you need to validate which user is calling the API, adapt behavior based on their org/team memberships, or provide LLMs with grounding before repository operations. [See the documentation](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user).",
27-30: Limit organization and team fetch at source
getOrganizations()issues a single request (default per_page = 30) and returns all results before slicing;getTeams()pulls every page viapaginate(). Modify both wrappers to accept pagination parameters and passper_page: DEFAULT_*_LIMITinstead of slicing:// components/github/github.app.mjs async getOrganizations(params = {}) { - const response = await this._client().request("GET /user/orgs", {}); + const response = await this._client().request("GET /user/orgs", params); return response.data; } async getTeams(params = {}) { - return this._client().paginate("GET /user/teams", {}); + return this._client().paginate("GET /user/teams", params); } // components/github/actions/get-current-user/get-current-user.mjs const [ user, - this.github.getOrganizations() - .then((orgs) => orgs.slice(0, DEFAULT_ORGS_LIMIT)), - this.github.getTeams() - .then((teams) => teams.slice(0, DEFAULT_TEAMS_LIMIT)), + this.github.getOrganizations({ per_page: DEFAULT_ORGS_LIMIT }), + this.github.getTeams({ per_page: DEFAULT_TEAMS_LIMIT }), ];
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
components/github/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_calendar/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_drive/actions/get-current-user/get-current-user.mjs(1 hunks)components/google_sheets/actions/get-current-user/get-current-user.mjs(1 hunks)components/linear/actions/get-current-user/get-current-user.mjs(1 hunks)components/notion/actions/get-current-user/get-current-user.mjs(1 hunks)components/slack/actions/get-current-user/get-current-user.mjs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- components/google_drive/actions/get-current-user/get-current-user.mjs
- components/slack/actions/get-current-user/get-current-user.mjs
- components/notion/actions/get-current-user/get-current-user.mjs
- components/google_sheets/actions/get-current-user/get-current-user.mjs
🧰 Additional context used
🧬 Code graph analysis (3)
components/github/actions/get-current-user/get-current-user.mjs (2)
components/linear/actions/get-current-user/get-current-user.mjs (2)
user(64-90)teams(45-62)components/slack/actions/get-current-user/get-current-user.mjs (1)
user(51-51)
components/google_calendar/actions/get-current-user/get-current-user.mjs (3)
components/google_drive/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/google_sheets/actions/get-current-user/get-current-user.mjs (1)
summaryName(22-25)components/slack/actions/get-current-user/get-current-user.mjs (1)
summaryName(53-57)
components/linear/actions/get-current-user/get-current-user.mjs (1)
components/github/actions/get-current-user/get-current-user.mjs (1)
user(21-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Lint Code Base
- GitHub Check: Verify TypeScript components
- GitHub Check: Publish TypeScript components
🔇 Additional comments (9)
components/linear/actions/get-current-user/get-current-user.mjs (5)
1-11: LGTM! Clean helper functions.The import and helper functions are well-structured. The
toIsoStringandtoPageInfohelpers safely handle optional values using optional chaining and guards.
13-26: LGTM! Metadata is complete and accurate.The action metadata is well-defined with appropriate annotations for a read-only introspection action.
45-62: LGTM! Teams mapping is comprehensive and safe.The team mapping extracts relevant fields and handles optional values appropriately with nullish coalescing.
64-101: LGTM! User and membership mappings are thorough.The user object and team memberships are well-structured with appropriate timestamp handling and safe defaults.
103-142: LGTM! Organization data construction is safe.The conditional construction with the guard clause appropriately handles cases where organization data may not be available.
components/google_calendar/actions/get-current-user/get-current-user.mjs (4)
1-4: LGTM! Clean imports and reasonable constant.The imports are appropriate, and the
DEFAULT_CALENDAR_SAMPLE_LIMITof 25 provides a sensible sample size for the calendar list without overwhelming the response.
6-19: LGTM! Well-defined action metadata.The action metadata is comprehensive and follows best practices:
- Clear, descriptive name and detailed description explaining the use case
- Appropriate annotations (readOnlyHint: true, destructiveHint: false)
- Minimal props focusing only on the required app instance
43-47: LGTM! Defensive programming with appropriate fallbacks.The optional chaining and fallback logic is well-implemented:
- Safe extraction of timezone and locale settings with
?.find?.- Reasonable fallback for the summary name (summary → id)
20-41: Verify error handling behavior for concurrent API calls. A failure in any of the four requests will reject the entire action without returning partial results; no other Google Calendar action usesPromise.allSettledor wraps these calls intry/catch. Confirm this all-or-nothing behavior is intentional.
| const summaryIdentifier = user.name || user.displayName || user.email || user.id; | ||
| $.export("$summary", `Retrieved Linear user ${summaryIdentifier}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove email from summary to avoid logging PII.
The summary includes user.email as a fallback identifier, which logs personally identifiable information (PII). Workflow summaries can be stored in logs, monitoring systems, or other persistence layers, creating compliance risks under GDPR/CCPA.
Apply this diff to remove email from the summary identifier:
-const summaryIdentifier = user.name || user.displayName || user.email || user.id;
+const summaryIdentifier = user.name || user.displayName || user.id;
$.export("$summary", `Retrieved Linear user ${summaryIdentifier}`);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const summaryIdentifier = user.name || user.displayName || user.email || user.id; | |
| $.export("$summary", `Retrieved Linear user ${summaryIdentifier}`); | |
| const summaryIdentifier = user.name || user.displayName || user.id; | |
| $.export("$summary", `Retrieved Linear user ${summaryIdentifier}`); |
🤖 Prompt for AI Agents
In components/linear/actions/get-current-user/get-current-user.mjs around lines
144 to 145, the summary currently falls back to user.email which logs PII;
remove user.email from the summaryIdentifier fallback list so it only uses
user.name, user.displayName, or user.id, and keep the export statement unchanged
to avoid emitting email in logs.
Starting with a handful of the top apps. These can be helpful for LLMs that are using our actions as tools to introspect the current user. For example, to get "my issues" in Linear, the LLM needs to know what teams teams the user is on, and to know that, it needs to know who the user is. The goal is to help reduce the tool calls involved in certain queries, and see if this pattern might be helpful more broadly.
WHY
Summary by CodeRabbit