Skip to content

Conversation

@raybell-md
Copy link

Closes #56 ?

This is a Jules PR (https://github.com/raybell-md/workspace/pull/2) so merge with caution. I haven't vetted it.

google-labs-jules bot and others added 2 commits December 4, 2025 18:57
This commit adds a new tool, `people.getUserManager`, which allows a user to retrieve their manager's information from Google Contacts.

The changes include:
- A new `getUserManager` function in `PeopleService.ts` to fetch the manager's data.
- The `personFields` in `getUserProfile` has been updated to include `relations`.
- A new command, `get_user_manager`, has been added to expose this functionality.
- Unit tests have been added to verify the new functionality.
feat: Add tool to read a user's manager from Google Contacts
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @raybell-md, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces the capability to programmatically retrieve a user's manager from Google Contacts. It extends the existing PeopleService with a dedicated function for manager lookup and enhances user profile retrieval to include relationship data. The changes ensure that the new functionality is properly integrated, tested, and exposed as a callable tool within the system, providing a more complete view of user organizational structures.

Highlights

  • New Tool Added: A new tool, get_user_manager, has been introduced to allow reading a user's manager information directly from Google Contacts.
  • PeopleService Enhancement: The PeopleService now includes a getUserManager method, responsible for querying the Google People API to retrieve a user's manager based on their ID.
  • Profile Data Expansion: The existing getUserProfile method in PeopleService has been updated to include 'relations' in the requested person fields, ensuring that manager information can also be fetched when retrieving a user's full profile.
  • Unit Tests: Comprehensive unit tests have been added for the new getUserManager functionality, covering both successful manager retrieval and error handling scenarios.
  • Tool Registration: The new people.getUserManager tool has been registered in the workspace-server to make it available for use within the system.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new tool to retrieve a user's manager from Google Contacts, along with corresponding service logic and unit tests. The changes are well-structured, and the new getUserManager functionality is a valuable addition. However, there are a couple of areas related to API clarity and efficiency that could be improved. Specifically, the return value for getUserManager when no manager is found could be more explicit, and the getUserProfile method appears to be fetching more data than it currently uses or returns, which could lead to unnecessary overhead.

const res = await people.people.get({
resourceName,
personFields: 'names,emailAddresses',
personFields: 'names,emailAddresses,relations',
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The getUserProfile method now requests relations in its personFields. However, the method's primary purpose, as indicated by its name and existing usage, is to retrieve basic profile information (names, email addresses). Fetching relations here, if not used or returned by getUserProfile, introduces unnecessary data retrieval, potentially increasing API call latency and resource consumption.
If relations data is not intended to be part of the getUserProfile's output, it should be removed from personFields to optimize the API call. If it is intended to be part of the output, then the method's return type and documentation should be updated, and tests should assert its presence.

Suggested change
personFields: 'names,emailAddresses,relations',
personFields: 'names,emailAddresses',

allenhutchison and others added 2 commits December 8, 2025 13:44
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Copy link
Contributor

Choose a reason for hiding this comment

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

This entire file appears to be a hallucination. It shouldn't be here, only toml files should be in the command directory.

}

public getUserManager = async ({ userId }: { userId: string; }) => {
logToFile(`[PeopleService] Starting getUserManager with: userId=${userId}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than a specific function to get a manager, it would be better to have a function that interacts with the relations object overall. Where finding the manager could be one of many data items returned from that function.

See: https://developers.google.com/people/api/rest/v1/people#Person.Relation for the full details.

@raybellwaves
Copy link
Contributor

raybellwaves commented Dec 9, 2025

FYI I pointed this PR (with comments) at some async coding tools. Prompt was "Fix #59"
Claude: raybellwaves@a931de3
Jules: Still running (I'll update when it runs).
Apologies I'm using this repo to explore async coding agents. Whilst it may be AI slop I feel it's worth exploring beyond creating issues and I don't have much dev time at the moment.

@allenhutchison
Copy link
Contributor

The commit you referenced in your last comment is looking better. More in line with what I would want to see in the repo. Let me know if you want me to take a pass at it. Also happy to have you work on this at your own pace.

@raybell-md raybell-md closed this by deleting the head repository Dec 10, 2025
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.

Feature Request: Read Contacts

3 participants