Skip to content

feat(settings): add rtk compression toggle, on by default#3257

Merged
tatoalo merged 1 commit into
mainfrom
posthog-code/rtk-settings-toggle
Jul 10, 2026
Merged

feat(settings): add rtk compression toggle, on by default#3257
tatoalo merged 1 commit into
mainfrom
posthog-code/rtk-settings-toggle

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Problem

rtk command-output compression is rolling out on by default: the runtime auto-detects the binary on PATH (#3096), and cloud sandboxes ship it in the image with POSTHOG_RTK set from the run's state (PostHog/posthog#69176). What's missing is the user-facing opt-out, one place in PostHog Code settings that turns it off across local, worktree, and cloud runs.

Changes

  • add a "Compress command output" setting under Advanced, enabled by default. The preference is persisted and available across desktop, web, and mobile.

  • apply the setting to local and worktree sessions by passing it through session creation and reconnect, setting POSTHOG_RTK=0 when disabled and restoring automatic detection when enabled.

  • apply the setting to cloud runs by sending rtk_enabled: false only when users opt out. When enabled, no value is sent so the server-side default continues to control rollout.

@tatoalo tatoalo self-assigned this Jul 8, 2026
@trunk-io

trunk-io Bot commented Jul 8, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 2d90dcc.

@tatoalo tatoalo marked this pull request as ready for review July 8, 2026 11:12
@tatoalo tatoalo added the Stamphog This will request an autostamp by stamphog on small changes label Jul 8, 2026

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Gates denied this PR because it touches auth-adapter files (POSTHOG_RTK env var injection in auth-adapter.ts), which fall under the deny-list. Additionally, this is classified as a T2-never PR with zero reviews. Get a review from a team member before re-requesting auto-approval.

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jul 8, 2026
@greptile-apps

greptile-apps Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(settings): split rtk toggle into lo..." | Re-trigger Greptile

Comment thread packages/ui/src/features/settings/sections/AdvancedSettings.tsx Outdated
@tatoalo tatoalo force-pushed the posthog-code/rtk-settings-toggle branch from 3a1851d to 6658ce9 Compare July 8, 2026 11:26
@tatoalo tatoalo requested a review from a team July 8, 2026 11:54
@tatoalo tatoalo force-pushed the posthog-code/rtk-settings-toggle branch from 6658ce9 to 69e4a90 Compare July 9, 2026 11:28
Two checkboxes in one settings row, both default on: Local (covers local and worktree sessions) and Cloud. Opting out sends POSTHOG_RTK=0 to local sessions via configureProcessEnv, which owns every per-session process env write, and rtk_enabled: false into cloud run creation and resume. Only false is ever sent so the enabled default stays a server-side decision. When Local is enabled but no rtk binary is installed, the row shows a binary-required hint backed by a new agent.rtkStatus query and detectRtkBinary, which reports installation independent of the toggle state a prior session left in the environment.
@tatoalo tatoalo force-pushed the posthog-code/rtk-settings-toggle branch from 69e4a90 to 2d90dcc Compare July 10, 2026 08:21
@tatoalo tatoalo enabled auto-merge (squash) July 10, 2026 08:25
@tatoalo tatoalo merged commit f980e59 into main Jul 10, 2026
26 checks passed
@tatoalo tatoalo deleted the posthog-code/rtk-settings-toggle branch July 10, 2026 08:28
Gilbert09 added a commit that referenced this pull request Jul 10, 2026
Adds a "Compress command output" cloud setting to the mobile app, on by default. When enabled, eligible shell command output on cloud runs is routed through rtk so verbose output is compressed before it reaches the model, reducing token usage.

Only the Cloud half of #3257 is ported: mobile has no local agent sessions, no workspace-server, and no rtk binary, so the desktop Local checkbox, the agent.rtkStatus query, and the "rtk binary not found" warning have no mobile equivalent.

The preference persists as rtkEnabledCloud (default true) and threads into every cloud-run start/resume path. Following the server default (enabled), only an explicit opt-out sends rtk_enabled: false; the enabled case sends nothing.

Generated-By: PostHog Code
Task-Id: eeb20b54-b0ff-4624-b0df-64ce78edbe50
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.

2 participants