Skip to content

feat(mobile): merge model and reasoning into one agent config control (port #3821) - #3998

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-merged-agent-config
Jul 30, 2026
Merged

feat(mobile): merge model and reasoning into one agent config control (port #3821)#3998
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/mobile-merged-agent-config

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Problem

The mobile app still exposed agent configuration as separate Model and Reasoning pills, and had no way to set the two new agent settings desktop shipped in #3821 (fast mode and context window). This ports that desktop change ("new agent harness selector") to apps/mobile for behavioral parity, using mobile-idiomatic UI.

Desktop PR: #3821.

Changes

Merged model + reasoning control. The two pills become one pill summarising the current model + effort (e.g. "Claude Opus 5 · Extra High"). It opens a bottom sheet with:

  • A Faster → Smarter preset scale that sets model and effort together, derived from the shared capability ladder (Sonnet 5 medium/high, Opus 5 medium/xhigh, Fable 5 max for Claude; the GPT ladder for Codex). Presets that aren't offered/allowed by the live config, or whose effort is unsupported, are dropped.
  • A fast mode toggle, gated on the same posthog-desktop-fast-mode flag as desktop (mobile reads it via posthog-react-native's useFeatureFlag), shown only for models that support it.
  • A context window (200k / 1M) control, shown only for models that support the 1M beta.
  • An Advanced section: harness (Claude/Codex), model, reasoning pickers, plus Reset to default (middle preset notch, default context window, fast mode off). Switching harness resets to that harness's middle preset.

Instead of the desktop drag-slider + dropdown-with-submenus, the sheet uses a preset list, segmented controls, and a collapsible Advanced section (no nested modals).

Payload. context_window and fast_mode now ride alongside reasoning_effort on cloud task creation and on sandbox warming, matching the desktop body shape (only sent for models that support them).

Persistence + migration. The selection persists (per-device defaults in preferencesStore, per-task in taskStore) and restores on the composers. The preferencesStore version is bumped to 1 with a migration so existing installs drop a stale last-used model/effort and land on the new defaults.

Shared policy. getCapabilityLadder, supports1MContext, and supportsFastMode were added to @posthog/shared (additive) so mobile reuses one policy rather than re-deriving lists.

Deliberately not ported

  • Live per-turn toggling of context window / fast mode on a running cloud session (desktop pushes these via set_config_option). Mobile persists the choice and applies it on the next run (create / resume / retry), which keeps the change contained; reasoning/model live-push is unchanged.
  • Single-sourcing the capability ladder with @posthog/agent. Desktop's ladder lives in @posthog/agent, which mobile cannot import. To respect the "don't touch desktop/agent" scope, @posthog/shared carries a mirrored copy (documented with a keep-in-sync comment) rather than refactoring @posthog/agent onto shared. That unification is a reasonable follow-up.

How did you test this?

  • pnpm --filter @posthog/mobile test — 563 passing. Added/updated unit tests for the preset mapping, harness-switch reset, persistence + migration, context-window gating, and the creation/warm payload fields (options.test.ts, AgentConfigControls.test.tsx, preferencesStore.test.ts, cloudTaskRunConfig.test.ts, useWarmTask.test.tsx).
  • pnpm --filter @posthog/shared --filter @posthog/api-client typecheck — clean.
  • Mobile tsc --noEmit — no new errors (one pre-existing SessionActivityState error unrelated to this change).
  • Biome lint clean across the changed files.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

… (port #3821)

Ports the desktop "new agent harness selector" (#3821) to apps/mobile.

Replaces the separate model and reasoning pills with a single merged pill that
opens a bottom sheet: a Faster→Smarter preset scale (model + effort together),
a fast-mode toggle (flag-gated), a 200k/1M context-window control, and an
Advanced section for picking harness/model/reasoning individually with reset.

Sends context_window and fast_mode on cloud task creation and sandbox warming,
persists the selection, and bumps the preferences store version once so stale
installs land on valid defaults.

Generated-By: PostHog Code
Task-Id: 2af7b99c-c87f-415b-81ef-95a656535821
@Gilbert09
Gilbert09 requested a review from a team July 30, 2026 11:09
@trunk-io

trunk-io Bot commented Jul 30, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit ed4b3d9.

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

@github-actions github-actions 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.

Contained mobile UI feature porting an already-shipped desktop capability (fast mode / context window), with additive-only backend payload fields and a well-tested, reversible local-preferences migration; no auth, billing, migration-of-server-data, or CI/dependency risk, and the diff matches the description.

  • Author wrote 1% of the modified lines and has 38 merged PRs in these paths (familiarity MODERATE).
Gate mechanics and policy version
Gate Result
prerequisites all clear
deny-list no deny categories matched
size 786L, 14F substantive, 1174L/19F incl. docs/generated/snapshots — within ceiling
tier T1-agent / T1d-complex (1174L, 19F, two-areas, feat)
stamphog 2.0.0b3 .stamphog/policy.yml @ 67f0052 · reviewed head ed4b3d9

@talyn-app

talyn-app Bot commented Jul 30, 2026

Copy link
Copy Markdown

/trunk merge

@trunk-io
trunk-io Bot merged commit d1f50cc into main Jul 30, 2026
42 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/mobile-merged-agent-config branch July 30, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant