Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(settings): configure default permissions for new threads #11346

Mergedmaria-rcksmerged 4 commits intomain fromrefs/pull/11346/headmerged by maria-rcks View on GitHub

maria-rckscommented

New threads can now start with configured permissions: Supervised, Auto-accept edits, Auto, or Full access. The Permissions setting sits below Model in New threads, supports environment defaults and project overrides, and applies to web/desktop drafts, mobile tasks, and startup threads through all six providers' existing permission mappings. Existing threads and explicit draft choices retain their permissions. Switching an implicit draft to another project/environment and implementing a plan in a new thread both use the destination default.

The selected permissions label shows the matching mode icon. All four icons were checked through the real settings dropdown; scoped lint, formatting, and the web typecheck passed after this update.

Verified: 203 focused settings/thread tests, 32 provider permission tests, web/mobile/server typechecks, and scoped lint (existing warnings). In the real web client, a Codex thread inherited Auto and completed a response; project overrides and reset-to-inherit worked. Retargeting changed an implicit draft to the destination default, an explicit Supervised choice survived reopening and reached the provider, and plan implementation started a new Auto session from a Supervised source. The review fixes passed 156 focused web tests. Inspected desktop dark and narrow light layouts. Native mobile runtime and live sessions for the other five providers remain unverified.

Before:

new-thread settings before default permissions

After:

selected permission icon in the closed dropdown

default permissions with all four supported modes

setting auto as the default and opening a new thread

Model: gpt-6. Harness: Codex.

Summary by CodeRabbit

  • New Features

    • Added configurable default permission modes for new threads in project settings, including project-specific overrides.
    • New threads now use the configured project default rather than inheriting permissions from the viewed thread.
    • Auto-started and pending tasks now respect the resolved project permission mode.
    • Added searchable settings access and clearer permission-mode descriptions.
  • Bug Fixes

    • Preserved existing permissions when reopening drafts or editing pending tasks.
  • Documentation

    • Updated permission-mode guidance, including defaults, overrides, and draft behavior.
    1. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    2. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — This PR adds a persistent environment/project permission-default setting and routes it into new-thread creation across web, mobile, and server bootstrap, changing the approval and sandbox policy used by new agent sessions. The product-default change and its runtime permission impact warrant human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    3. coderabbitai[bot](GitHub profile, opens in a new tab)commented
      Review Change StackReview Change Stack

      No actionable comments were generated in the recent review. 🎉

      ℹ️ Recent review info
      ⚙️ Run configuration

      Configuration used: Path: .coderabbit.yaml

      Review profile: CHILL

      Plan: Advanced

      Run ID: 1aacc99d-cb2d-4ecf-a18a-8af1b6f1b6cc

      📥 Commits

      Reviewing files that changed from the base of the PR and between 56bcbef628af28f8502457d883e5a983eeb5cfcb and 8dc2126864da4ff5c24adbeb9acf73b09dea37b2.

      📒 Files selected for processing (1)
      • apps/web/src/components/settings/ProjectDefaultsSettings.tsx

      Included review availability: Your plan provides up to 10 included reviews per hour; 3 remain after this review.


      📝 Walkthrough

      Walkthrough

      The change adds a project-scoped default runtime mode, exposes it in project settings, validates its contract, and applies it to web, mobile, pending-task, draft, and auto-bootstrap thread flows.

      Changes

      Runtime mode defaults

      Layer / File(s)Summary
      Runtime mode settings contract
      packages/contracts/src/settings.ts, packages/contracts/src/settings.test.ts
      Adds defaultRuntimeMode to server settings, project overrides, and patches. Legacy settings default to full-access. Tests cover supported and invalid values.
      Runtime mode settings UI
      apps/web/src/components/chat/*, apps/web/src/components/settings/ProjectDefaultsSettings.tsx, apps/web/src/components/settings/settingsSearch.ts
      Centralizes runtime mode labels and icons. Adds project default-permissions selection, reset, mixed-state, and search support.
      Client thread runtime defaults
      apps/web/src/hooks/useHandleNewThread.ts, apps/web/src/components/ChatView.tsx, apps/mobile/src/features/threads/new-task-flow-provider.tsx, apps/web/src/hooks/useHandleNewThread.test.ts, docs/user/permission-modes.md
      New threads use the resolved project default. Pending tasks preserve stored modes. Documentation describes the updated behavior.
      Server auto-bootstrap runtime mode
      apps/server/src/serverRuntimeStartup.ts, apps/server/src/serverRuntimeStartup.test.ts
      Auto-bootstrap threads use resolved project settings. Tests verify project modes override machine defaults.

      Priority: ➖ Normal

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

      Change: Feature

      Sequence Diagram(s)

      sequenceDiagram
        participant ProjectSettings
        participant useHandleNewThread
        participant ChatView
        participant ServerRuntimeStartup
        participant DraftThreadState
        ProjectSettings->>useHandleNewThread: resolved defaultRuntimeMode
        useHandleNewThread->>DraftThreadState: set runtimeMode for new thread
        ProjectSettings->>ChatView: resolved project settings
        ChatView->>DraftThreadState: set runtimeMode for draft or implementation thread
        ProjectSettings->>ServerRuntimeStartup: resolved project settings
        ServerRuntimeStartup->>DraftThreadState: create auto-bootstrap thread with runtimeMode

      Possibly related PRs

      • pingdotgg/t3code#10811: Both changes modify runtime mode selection for new threads. This pull request applies the project-configured default across the supported creation flows.

      Suggested reviewers: juliusmarminge

      Merge Risk: ⚪ Minimal · up to 8dc21

      The configurable permission defaults are ready to merge; the reviewed flows preserve explicit choices and apply the resolved project or environment default to new threads.

      🚥 Pre-merge checks | ✅ 4 | ❌ 1

      ❌ Failed checks (1 warning)

      Check nameStatusExplanationResolution
      Docstring Coverage⚠️ WarningDocstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 12 files.Write docstrings for the functions missing them to satisfy the coverage threshold.
      ✅ Passed checks (4 passed)
      Check nameStatusExplanation
      Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
      Title check✅ PassedThe title clearly and concisely describes the main change: configuring default permissions for new threads.
      Description check✅ PassedThe description explains the behavior, scope, UI changes, verification, screenshots, and known validation gaps. It does not use the template headings or include an explicit checklist, but it is mostly…
      • Fix all pre-merge checks with AI
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Comment `@coderabbitai help` to get the list of available commands.
    4. maria-rcks merged thiscf1ba3d

    5. maria-rcks closed this

Sign in to join this conversation.