Skip to content

feat(scient): use the person's ChatGPT apps through the ChatGPT sign-in - #57

Merged
yaacovcorcos merged 3 commits into
mainfrom
claude/chatgpt-apps-20261114
Nov 14, 2026
Merged

yaacovcorcos merged 3 commits into
mainfrom
claude/chatgpt-apps-20261114

Conversation

@yaacovcorcos

Copy link
Copy Markdown
Contributor

Scient Agent can now use the apps a person connected in ChatGPT, such as Gmail, Google Drive and Calendar, through its own ChatGPT sign-in. It uses the same apps server that Codex uses (chatgpt.com/backend-api/ps/mcp).

What's new

  • scient-agent apps [--json] lists the connected apps, so Scient Desktop can show them in Extensions.
    • Output: { "apps": [{ "id", "name", "description"?, "tools", "readOnlyTools" }] }.
    • On failure it prints { "error": { "kind": "signed-out" | "unavailable", "message" } } and exits 1.
  • SCIENT_AGENT_CHATGPT_APPS lets a host choose apps for its sessions: all, app ids, or -<id> to leave one out.
    • The chosen apps' tools are registered at session start as discoverable tools named <app>__<tool>, which load on demand under xd://.
    • ChatGPT's own connector_openai_* features are left out.
    • Without the variable, nothing changes.
  • Tool results include the app's structured data, where ChatGPT's apps put what they found.
  • A Google link that needs signing in again comes back as an error with the app's ChatGPT connect page.
  • Sign-in: the shared OAuth retry refreshes or rotates the credential, as it does for dictation.
  • Lost session: a session ChatGPT forgot is opened again once. No other call is ever retried.

Checked

  • bun test test/scient passes (91), along with type-check, lint, format and the divergence check.
  • Live, read-only, on the owner's account:
    • apps --json listed 18 apps (Gmail 21 tools, Google Drive 45, Calendar 15, ...).
    • A real session with SCIENT_AGENT_CHATGPT_APPS=all on GPT-6 Luna answered "how many emails did I get in the last 2 days" through xd://gmail__search_email_ids.
    • Record: reviews/account-apps-20261114/RECORD.md in the ScientFactory workspace.

Platforms: the code has no platform-specific parts. I tested on macOS only; Windows and Linux behave the same, and only the CI build covers them.

Release: this ships in the next Scient Agent release, which is held until #53 merges. Scient Desktop gates on that version.

Scient-Divergence: SA-CHATGPT-APPS

🤖 Generated with Claude Code

yaacovcorcos and others added 2 commits November 14, 2026 18:00
The apps a person connected in ChatGPT (Gmail, Google Drive, Calendar and
the others) sit behind one MCP server of ChatGPT's, the one the Codex apps
use. Scient Agent now reaches it with the stored openai-codex sign-in,
through the shared OAuth retry.

`scient-agent apps [--json]` lists the connected apps, so a host can show
them. A host that sets SCIENT_AGENT_CHATGPT_APPS (`all`, app ids, `-<id>`
to leave one out) gets the chosen apps' tools in its sessions, named
<app>__<tool> and loaded on demand under xd://. ChatGPT's own
connector_openai_* features are never listed or registered. A tool result
carries the app's structured data, which holds what it found. A lost link
to the service says where to reconnect the app.

Scient-Divergence: SA-CHATGPT-APPS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A host learns from hostCommands that this build has `apps` and
`dictate`; an executable without a command reads the word as a prompt,
so checking the list is safer than guessing from the version.

Scient-Divergence: SA-PRODUCT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A client now stays on the ChatGPT account its first request used: the
OAuth retry resolves one stored sign-in for it, and a call that would run
through another account is refused instead of reaching that account's
apps. Listings are kept per credential store, so another store's sessions
in the same process never share a client.

Scient-Divergence: SA-CHATGPT-APPS

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yaacovcorcos

Copy link
Copy Markdown
Contributor Author

Two follow-up commits on this PR:

  • --runtime-info now lists hostCommands: ["apps", "dictate"], so a host can check for a command instead of guessing from the version. An older executable would read the command's word as a prompt. This one is under SA-PRODUCT.
  • After review: a client stays on the ChatGPT account that listed its apps. It resolves one stored sign-in, and a call that would run through another account is refused. Listings are kept per credential store.

🤖 Generated with Claude Code

@yaacovcorcos
yaacovcorcos merged commit c830696 into main Nov 14, 2026
8 checks passed
@yaacovcorcos
yaacovcorcos deleted the claude/chatgpt-apps-20261114 branch November 14, 2026 16:36
This was referenced Nov 14, 2026
yaacovcorcos added a commit that referenced this pull request Nov 15, 2026
ChatGPT apps through the person's ChatGPT sign-in, with `apps --json` and the host command list in `--runtime-info` (#57). Hosts learn when the prompt cache expires (#59). Plan mode for RPC hosts (#60).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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