Skip to content

feat(harness): integrate pi runtime into desktop app#3469

Open
jonathanlab wants to merge 1 commit into
pi-harness-runtimefrom
07-15-feat_harness_integrate_pi_runtime_into_desktop_app
Open

feat(harness): integrate pi runtime into desktop app#3469
jonathanlab wants to merge 1 commit into
pi-harness-runtimefrom
07-15-feat_harness_integrate_pi_runtime_into_desktop_app

Conversation

@jonathanlab

@jonathanlab jonathanlab commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

This sets up all the wiring needed to run Pi in the desktop app. We use a dummy conversation view, which is replaced by the ChatThread in the next PR.

it also alters taskmetadata to temporarily include these two:

ALTER TABLE `task_metadata` ADD `runtime` text;--> statement-breakpoint
ALTER TABLE `task_metadata` ADD `pi_session_file` text;

Until we distinguish by runtime via posthog django models

jonathanlab commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ed3507d.

@jonathanlab jonathanlab marked this pull request as ready for review July 15, 2026 11:34
@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Security Review

The new Pi-session routes do not validate task ownership before controlling sessions or returning events. The child process also receives a reusable OAuth credential snapshot through its environment, which can become invalid when refresh tokens rotate.

Reviews (1): Last reviewed commit: "feat(harness): integrate pi runtime into..." | Re-trigger Greptile

Comment thread packages/host-router/src/routers/pi-session.router.ts
Comment thread packages/workspace-server/src/services/pi-session/pi-session.ts Outdated
Comment thread apps/code/vite-main-plugins.mts
Comment on lines +34 to 41
const oauthEnvironment: Record<string, string> = {
POSTHOG_OAUTH_CREDENTIALS: JSON.stringify(oauthCredentials),
};
const childEnvironment: Record<string, string> = {
...env,
...oauthEnvironment,
};

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.

P1 security Child Credentials Diverge After Refresh

The child receives a one-time copy of the desktop access and refresh tokens. If the provider rotates refresh tokens and the parent refreshes first, the long-running child retains the invalidated token and its next refresh fails even though the desktop remains signed in, interrupting the Pi session.

@jonathanlab jonathanlab changed the base branch from pi-harness-runtime to graphite-base/3469 July 15, 2026 11:45
@jonathanlab jonathanlab force-pushed the 07-15-feat_harness_integrate_pi_runtime_into_desktop_app branch from 745cd4b to b8845b7 Compare July 15, 2026 14:00
@jonathanlab jonathanlab changed the base branch from graphite-base/3469 to pi-harness-runtime July 15, 2026 14:00
@jonathanlab jonathanlab changed the base branch from pi-harness-runtime to graphite-base/3469 July 15, 2026 14:15
@jonathanlab jonathanlab force-pushed the 07-15-feat_harness_integrate_pi_runtime_into_desktop_app branch from b8845b7 to 9485f63 Compare July 15, 2026 14:23
@jonathanlab jonathanlab changed the base branch from graphite-base/3469 to pi-harness-runtime July 15, 2026 14:23
@jonathanlab jonathanlab changed the base branch from pi-harness-runtime to graphite-base/3469 July 15, 2026 14:37
@jonathanlab jonathanlab force-pushed the 07-15-feat_harness_integrate_pi_runtime_into_desktop_app branch from 9485f63 to 401dd8d Compare July 15, 2026 14:42
@jonathanlab jonathanlab changed the base branch from graphite-base/3469 to pi-harness-runtime July 15, 2026 14:42
@jonathanlab jonathanlab force-pushed the 07-15-feat_harness_integrate_pi_runtime_into_desktop_app branch from 401dd8d to ed3507d Compare July 15, 2026 15:07
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