fix(threads): side chats inherit parent permissions by default#31114

merged1
main
GitHub fork: fix/side-chat-inherit-permissions
opened6d agobyEextoci
View on GitHubTwo-way sync enabledPR last imported 5d ago

A /btw or /side chat opened from a Full access thread starts Supervised and asks for approvals. Creation, the slash-command first message, and provider startup each force that downgrade.

Side chats now copy the parent's current permission mode when created and use it from the first turn. The existing per-thread permission picker still works independently; later parent changes do not update existing side chats. This removes the three overrides and adds no setting or contract field. Existing managed-policy and connection permission checks still apply.

This is a standalone alternative to #29300 and #29994, requested by a maintainer, with inheritance as the default. Context handoff behavior is unchanged.

Validation:

  • Reproduced before the fix with five failing regression cases: inherited Full access became Supervised at creation and at provider startup, including failed/cancelled context delivery retries and a provider switch.
  • Extended existing tests for all four inherited modes, an explicit Supervised child, independent parent/child permission changes, and creation while the parent is busy.
  • vp run check:changed passed, including 62 tests, affected-package typechecks, format, lint, knip, GraphQL, and React Compiler checks.
  • Ran an authenticated WebSocket check against an isolated development server with an empty database and a synthetic project:
text
1New side chat inherits Full access: PASS
2Parent changed to Supervised, child stays Full access: PASS
3Child changed to Auto independently: PASS

Web and desktop creation entry points share the updated hook. The shared server path applies to every provider and to side chats opened on mobile. Native clients, remote/relay/tunnel connections, and an integrated browser pass were not exercised. No paid model turns were used. Evidence contains only synthetic data; no user screenshots, prompts, credentials, or personal data were uploaded.

Created with GPT-6.1 Sol in the Codex harness.

Checks

23 successful · 13 skipped · 1 neutral
All checks passed
d7b9f88

Added 1 commit

  • fix(threads): side chats inherit parent permissions by defaultd7b9f88
Synced from GitHub

Approvability

Verdict: Needs Human Approval

Macroscope's review found this PR requires human approval — Side chats now inherit parent permissions, removing the initial approval requirement when the parent permits unsupervised actions. Human review must confirm this changed default for edits and commands in the shared worktree.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Side chats now retain the parent thread’s runtime mode when created. Policy resolution and the initial turn use the side chat’s configured mode. The client also handles an unavailable side-chat shell by discarding the thread and returning an error.

Changes: Side-chat permissions

Layer / File(s)Summary
Fork runtime mode inheritance
apps/server/src/orchestration-v2/ThreadForkService.ts, apps/server/src/orchestration-v2/ThreadForkService.test.ts, apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
Forked side chats retain the source thread’s runtime mode. Tests cover default and explicit modes, independent parent and side-chat changes, and busy-parent creation.
Runtime policy resolution
apps/server/src/orchestration-v2/ProviderTurnStartService.ts, apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts
Policy resolution now receives the stored thread projection without a side-chat-specific override. Tests cover configured modes in several turn contexts.
Initial side-chat turn
apps/web/src/components/chat/useSideChat.ts, docs/user/thread-sidebar.md
The client uses the created side chat’s runtime mode for its initial turn. If its shell is unavailable, the client reports an error and discards the thread. The documentation describes inherited and independently changeable permissions.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • pingdotgg/t3code#28110 — Reports that a side chat configured with Full access runs its first turn as Supervised; this change removes the first-turn downgrade.
  • pingdotgg/t3code#29966 — Requests that side chats inherit the parent’s permission mode; this change retains the source mode when forking.
  • pingdotgg/t3code#29010 — Reports that a Full Access selection before the first side-chat message is ignored; this change uses the created side chat’s mode for that turn.

Possibly related PRs

Suggested labels: bugfix

Suggested reviewers: t3dotgg, juliusmarminge, maria-rcks

Merge Risk: External image Minimal · up to d7b9f

Side chats inherit the parent’s permissions for their first turn and can then be configured independently. No material merge-blocking issue was established.

Pre-merge checks: Passed 4
Check nameStatusExplanation
Title checkPassedThe title clearly and concisely describes the main change: side chats inherit parent permissions by default.
Description checkPassedThe description explains the problem, change, scope, affected behavior, verification results, and untested environments. It does not use the template headings or provide a direct approval link, but it…
Linked Issues checkPassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkPassedCheck skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the problem, change, scope, affected behavior, verification results, and untested environments. It does not use the template headings or provide a direct approval link, but it includes the required information and is mostly complete.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
External image Recent review info
External image Run configuration
External image Commits

Reviewing files that changed from the base of the PR and between 7f6f47b27b44456f1c8214d3b566b375c09f629e and d7b9f88faa209b585dc682f4446b6779f72a01ce.

External image Files selected for processing: 7
  • apps/server/src/orchestration-v2/ProviderTurnStartService.test.ts
  • apps/server/src/orchestration-v2/ProviderTurnStartService.ts
  • apps/server/src/orchestration-v2/ThreadFork.execution.test.ts
  • apps/server/src/orchestration-v2/ThreadForkService.test.ts
  • apps/server/src/orchestration-v2/ThreadForkService.ts
  • apps/web/src/components/chat/useSideChat.ts
  • docs/user/thread-sidebar.md
External image Files with no reviewable changes: 1
  • apps/server/src/orchestration-v2/ThreadForkService.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.