Skip to content

fix(runtime): keep remote activation publish-only - #9029

Closed
bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/runtime-activation-publish-only
Closed

bbingz wants to merge 1 commit into
stablyai:mainfrom
bbingz:fix/runtime-activation-publish-only

Conversation

@bbingz

@bbingz bbingz commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make paired runtime-client worktree and session-tab activation publish selection state without navigating or focusing the host renderer by default
  • require an explicit followHost: true opt-in before a runtime client can drive host-window activation
  • send both notifyClients: false and followHost: false from remote-session clients, so the safe default also works against older hosts that do not know followHost
  • preserve existing mobile and in-process activation behavior

Related to #8871. This is the activation/focus companion to #8872 and #8888.

Screenshots

No visual change.

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Focused verification:

  • pnpm exec vitest run --config config/vitest.config.ts across 13 affected runtime/RPC/renderer test files: 889 tests passed
  • git diff --name-only -z origin/main | xargs -0 pnpm exec oxlint
  • pnpm run check:max-lines-ratchet
  • git diff --check

AI Review Report

The review traced worktree and tab activation from the renderer client, through RPC parsing and client-kind context, into the runtime notifier boundary. It checked both halves of mixed-version compatibility: a new client stays publish-only against an older host via notifyClients: false, while a new host defaults older runtime clients to publish-only unless they explicitly send followHost: true.

The main risk was accidentally changing phone activation or local/in-process navigation. The implementation therefore gates only clientKind === 'runtime'; focused tests verify runtime defaults and explicit opt-in, while the existing mobile activation suite remains green. The review also checked macOS, Linux, Windows, and SSH impact. This change introduces no platform-specific shortcuts, labels, paths, shell behavior, or Electron platform branches.

Security Audit

The new field is schema-validated as a boolean and reaches only the existing host focus/navigation notifier boundary. It does not add command execution, file/path handling, credentials, secrets, dependencies, destructive terminal actions, or a new IPC transport. The default for paired runtime clients is deny-by-default host navigation; explicit followHost: true restores the existing navigation capability for trusted callers that intentionally request it.

Notes

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: d1fc4cb2-ea80-46fb-b61d-6695be087ff3

📥 Commits

Reviewing files that changed from the base of the PR and between ef23b67 and 311c648.

📒 Files selected for processing (14)
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/session-tabs-schemas.ts
  • src/main/runtime/rpc/methods/session-tabs.test.ts
  • src/main/runtime/rpc/methods/session-tabs.ts
  • src/main/runtime/rpc/methods/worktree-schemas.ts
  • src/main/runtime/rpc/methods/worktree.test.ts
  • src/main/runtime/rpc/methods/worktree.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.test.ts
  • src/renderer/src/components/terminal-pane/remote-runtime-pty-transport.ts
  • src/renderer/src/lib/worktree-activation-created-agent.test.ts
  • src/renderer/src/lib/worktree-activation.ts
  • src/renderer/src/runtime/web-runtime-session.test.ts
  • src/renderer/src/runtime/web-runtime-session.ts

📝 Walkthrough

Walkthrough

Added explicit followHost handling to session-tab and worktree activation schemas, RPC handlers, runtime methods, and renderer APIs. Runtime-client requests remain publish-only unless followHost: true is supplied, while mobile and runtime activation paths forward client context and activation flags. Host-session attachment calls now send explicit notification and follow flags, and web worktree activation replaces notifyDesktop with followHost. Tests cover RPC arguments, runtime notifier behavior, and renderer request payloads.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: keeping remote activation publish-only by default.
Description check ✅ Passed The description follows the required template and includes summary, screenshots, testing, AI review, security audit, and notes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bbingz

bbingz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Rebase status: CLOSE_CANDIDATE (not pushed)

Main already implements publish-only remote activation via resolveRuntimeNavigationTarget in src/shared/runtime-navigation.ts:

  • when clientKind is set (mobile | runtime), navigation defaults to 'caller' (does not focus/navigate the host)
  • worktree.activate / session.tabs.activate pass clientKind into that resolver
  • remote clients already send notifyClients: false, navigation: 'caller'

This PR’s followHost API appears superseded by the RuntimeNavigationTarget model. Please confirm before closing.

@bbingz

bbingz commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded on current main by the navigation-target model:

  • resolveRuntimeNavigationTarget in src/shared/runtime-navigation.ts (clientKind → default navigation: 'caller')
  • host gates via navigationTargetsHost on worktree/tab activate
  • paired clients already send notifyClients: false + navigation: 'caller'

The PR’s followHost boolean is obsolete vs navigation: 'host'|'caller'|…. Independent review: CLOSE_SUPERSEDED (high confidence); no critical residual for the publish-only remote activation goal.

@bbingz bbingz closed this Jul 22, 2026
@bbingz
bbingz deleted the fix/runtime-activation-publish-only branch August 1, 2026 00:47
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.

3 participants