Skip to content

Add the instance setting that restricts follow-up comments to assigned users #2895

Closed

Description

@propr-dev

Context

The request: "On instance level it should also be possible to set only comments made by assigned task users to be processed as followups (changeable from settings)."

Today, who may start follow-up work is decided by filterCommentByAuthor (the GITHUB_USER_WHITELIST / blacklist / bot rules) and checkCommentTrigger (processing label or trigger keyword). Both are instance-wide: on a team, any whitelisted person's comment on any ProPR pull request starts work. The new setting adds a per-task dimension - only people assigned to that task may start follow-up work on it.

This task adds the setting end to end as configuration: the persisted value, the validated write path, the settings projection, the Web UI control, the CLI key and the MCP field. It deliberately does not enforce it; enforcement is the next task, so the two stay separately reviewable and the setting can be shipped off by default before the intake path changes.

The setting is followup_requires_assignment, a boolean defaulting to false. False is the correct default because turning it on changes who can start work, and a silent change to that on upgrade would strand single-developer instances whose tasks are never assigned.

Requirements

  1. Add followup_requires_assignment as a specialized setting: a seeding migration with false, load/save accessors in core, SPECIALIZED_SETTING_NAMES, extractSettingSaves validation, and the getSettings projection.
  2. Validate strictly as a boolean, rejecting strings, consistent with auto_resolve_merge_conflicts and dashboard_summary_enabled.
  3. Expose it in the Web UI Settings page, in the Automation category beside the merge-conflict default, with copy that states exactly what it changes and that it has no effect on a task nobody is assigned to.
  4. Add it to the CLI settings keys (VALID_SETTING_KEYS, parseSettingValue, the description map) so propr setting update followup_requires_assignment true works.
  5. Add it to the MCP settingsShape in toolsManagement.ts with a description.
  6. Tests covering the validation, the projection default, the save round-trip and the CLI parser.

Implementation Specification

Files added

  • packages/core/src/db/migrations/20261012020000_seed_followup_requires_assignment.js
  • packages/core/src/config/configManagerAssignment.ts

Files modified

  • packages/core/src/config/configManager.ts - re-export the accessors.
  • packages/api/routes/configHelpers.ts - add to SPECIALIZED_SETTING_NAMES.
  • packages/api/routes/configSettings.ts - add to SettingFields, SettingSaveName and extractSettingSaves.
  • packages/api/routes/configRoutesSettings.ts - destructure and forward the field.
  • packages/api/routes/configRoutes.ts - include it in getSettings.
  • packages/api/mcp/toolsManagement.ts - add to settingsShape.
  • packages/cli/src/api/settings.ts - types, keys and parser.
  • packages/cli/src/commands/settingCommands.ts - description.
  • propr-ui/src/api/proprTypes.ts, propr-ui/src/pages/SettingsPage/types.ts, parseLoadedData.ts, useSettingsState.ts, GeneralSettingsSection.tsx, index.tsx.

Step-by-step

  1. Seed the config key with false using the INSERT ... ON CONFLICT IGNORE pattern from 20260327000000_seed_auto_resolve_merge_conflicts.js, so existing instances are explicitly off rather than relying on an absent key.
  2. Add loadFollowupRequiresAssignment / saveFollowupRequiresAssignment in a small core module, reusing parseBooleanSetting from mergeConflictSettingsResolution.ts so a double-JSON-encoded value is read the same way as the merge-conflict setting.
  3. Thread the setting through the API's specialized-settings machinery, following auto_resolve_merge_conflicts at every step.
  4. Add the Web UI control to the Processing group of GeneralSettingsSection, and register the keyword in the section's searchText in SettingsPage/index.tsx.
  5. Add the CLI and MCP surfaces.
  6. Add tests.

Acceptance Criteria

  • npm run typecheck, npm run lint and the API tests pass.
  • A fresh and an upgraded database both report followup_requires_assignment: false.
  • POST /api/config/settings with true persists; with "true", 1 or null returns 400 naming the field.
  • GET /api/config/settings always includes the field as a boolean.
  • The setting round-trips through the Settings page, is saved on change like the other Automation toggles, and its copy states that it has no effect on an unassigned task.
  • The setting is findable by searching Settings for "assignment", "assignee" or "follow-up".
  • propr setting get lists it with its description; propr setting update followup_requires_assignment true succeeds and ... 1 is rejected with a clear message.
  • The MCP update_execution_settings tool accepts it and get_execution_settings returns it.
  • No follow-up behaviour changes in this task: nothing reads the setting yet.

Created by ProPR AI Planner

Activity

  1. propr-dev commented on Oct 8, 2026

    @propr-dev
    ContributorAuthor

    Suggested Implementation:

    Implementation Approach

    This is a specialized setting, not a general one. ProPR has two storage shapes: general settings live inside the single settings JSON blob, and specialized settings get their own system_configs key, listed in SPECIALIZED_SETTING_NAMES and written as individual rows inside the settings transaction. Specialized is correct here for the same reason auto_resolve_merge_conflicts is: it is read on a hot non-HTTP path (comment intake, in the daemon and the worker) where loading and parsing the whole settings blob to answer one boolean is wasteful, and where an unrelated malformed key in the blob must not be able to break the read.

    The default is false, seeded explicitly rather than left absent. Two reasons. First, turning this on changes who can start work, and inheriting it silently on upgrade would break every single-developer instance, where tasks are never assigned and so every comment would stop being actionable. Second, an explicitly seeded row makes the value visible in system_configs, which matters when diagnosing "why did my comment do nothing".

    Validation is strict boolean, matching auto_resolve_merge_conflicts. Accepting "true" was considered for CLI convenience and rejected: the CLI already has parseSettingValue to convert its strings, so loosening the API would only create a second, weaker contract for the same field.

    The UI copy carries the one thing an operator cannot infer: that the setting has no effect on a task nobody is assigned to. Without that sentence, the obvious reading is "nothing works unless assigned", which would make the setting look far more dangerous than it is and discourage its use.

    Enforcement is deliberately absent here. Shipping the setting first means it can be merged, defaulted off, and reviewed on its own; the intake change that reads it is a separate, focused diff.

    File: packages/core/src/db/migrations/20261012020000_seed_followup_requires_assignment.js (new file)

    Why this file: seeds the key explicitly so existing instances are visibly off rather than relying on an absent row. It follows 20260327000000_seed_auto_resolve_merge_conflicts.js exactly, including the idempotent insert, so rerunning migrations is harmless.

    /**
     * Seeds the follow-up assignment gate as explicitly disabled.
     *
     * Seeded rather than left absent for two reasons: this setting changes who can
     * start work, so inheriting it on upgrade would strand single-developer
     * instances whose tasks are never assigned; and a visible row in system_configs
     * is what makes "why did my comment do nothing" diagnosable.
     */
    export async function up(knex) {
      await knex('system_configs')
        .insert({ key: 'followup_requires_assignment', value: JSON.stringify(false) })
        .onConflict('key')
        .ignore();
    }
    
    export async function down(knex) {
      await knex('system_configs').where({ key: 'followup_requires_assignment' }).delete();
    }

    File: packages/core/src/config/configManagerAssignment.ts (new file)

    Why this file: comment intake runs in the daemon and the worker, outside any HTTP request, so it needs a plain core accessor rather than reaching through an API route. Reusing parseBooleanSetting means a double-JSON-encoded value (which the config store has produced historically) is read identically to the merge-conflict setting instead of being silently treated as truthy.

    import { getConfig, saveConfig } from './configStore.js';
    import { parseBooleanSetting } from './mergeConflictSettingsResolution.js';
    import logger from '../utils/logger.js';
    
    export const FOLLOWUP_REQUIRES_ASSIGNMENT_CONFIG_KEY = 'followup_requires_assignment';
    
    /**
     * Whether a follow-up comment must come from someone assigned to the task.
     *
     * Returns false for a missing or malformed value. Fail-open is deliberate here
     * and is the opposite of the per-task assignment check: a corrupt setting must
     * not silently stop every follow-up on the instance. The narrow check (is this
     * person assigned?) fails closed; the broad switch (is the gate on at all?)
     * fails open.
     */
    export async function loadFollowupRequiresAssignment(): Promise<boolean> {
      const stored = await getConfig<unknown>(FOLLOWUP_REQUIRES_ASSIGNMENT_CONFIG_KEY, false);
      const parsed = parseBooleanSetting(stored);
      if (parsed === null) {
        logger.warn({ stored }, 'Invalid followup_requires_assignment value; treating the gate as disabled');
        return false;
      }
      return parsed;
    }
    
    export async function saveFollowupRequiresAssignment(enabled: boolean): Promise<boolean> {
      await saveConfig(FOLLOWUP_REQUIRES_ASSIGNMENT_CONFIG_KEY, enabled);
      logger.info({ followup_requires_assignment: enabled }, 'Saved the follow-up assignment gate');
      return true;
    }

    File: packages/core/src/config/configManager.ts

    Why this file: configManager is the facade every consumer imports, and packages/core/src/index.ts re-exports it wholesale. Adding the re-export here is what makes the accessor reachable from the daemon, the worker and the API at once.

    --- a/packages/core/src/config/configManager.ts
    +++ b/packages/core/src/config/configManager.ts
    @@
     export {
         loadAgentNetworkOverrides,
         loadInstanceNetworkPolicy,
         saveAgentNetworkSetting,
     } from './configManagerAgentNetwork.js';
    +// Follow-up assignment gate: read on the comment intake path, so it is a plain
    +// core accessor rather than an API-only concern.
    +export {
    +    FOLLOWUP_REQUIRES_ASSIGNMENT_CONFIG_KEY,
    +    loadFollowupRequiresAssignment,
    +    saveFollowupRequiresAssignment
    +} from './configManagerAssignment.js';

    File: packages/api/routes/configHelpers.ts

    Why this file: SPECIALIZED_SETTING_NAMES is what makes a key its own system_configs row instead of a field inside the settings blob. Omitting it here would leave the value written into the blob, where the core accessor would never find it.

    --- a/packages/api/routes/configHelpers.ts
    +++ b/packages/api/routes/configHelpers.ts
    @@
       'auto_resolve_merge_conflicts',
    +  // Its own key, not a field in the settings blob: comment intake reads it on
    +  // a hot non-HTTP path, where parsing the whole blob for one boolean is waste
    +  // and an unrelated malformed key must not be able to break the read.
    +  'followup_requires_assignment',
       'dashboard_summary_enabled',

    File: packages/api/routes/configSettings.ts

    Why this file: this is the one validator for specialized settings, and stripSpecializedSettings relies on the name being known here. A key in SPECIALIZED_SETTING_NAMES but not in extractSettingSaves would be stripped from the blob and never written anywhere.

    --- a/packages/api/routes/configSettings.ts
    +++ b/packages/api/routes/configSettings.ts
    @@
     interface SettingFields {
    @@
       auto_resolve_merge_conflicts?: unknown;
    +  followup_requires_assignment?: unknown;
       dashboard_summary_enabled?: unknown;
    @@
       | 'auto_resolve_merge_conflicts'
    +  | 'followup_requires_assignment'
       | 'dashboard_summary_enabled'
    @@ in extractSettingSaves, beside the auto_resolve_merge_conflicts block
       if (fields.auto_resolve_merge_conflicts !== undefined) {
         if (typeof fields.auto_resolve_merge_conflicts !== 'boolean') return { error: 'auto_resolve_merge_conflicts must be a boolean', saves: [], normalized };
         normalized.auto_resolve_merge_conflicts = fields.auto_resolve_merge_conflicts;
         saves.push({ name: 'auto_resolve_merge_conflicts' });
       }
     
    +  if (fields.followup_requires_assignment !== undefined) {
    +    // Strict boolean, like the other switches here. The CLI already converts
    +    // its strings in parseSettingValue, so loosening this would only create a
    +    // second, weaker contract for the same field.
    +    if (typeof fields.followup_requires_assignment !== 'boolean') {
    +      return { error: 'followup_requires_assignment must be a boolean', saves: [], normalized };
    +    }
    +    normalized.followup_requires_assignment = fields.followup_requires_assignment;
    +    saves.push({ name: 'followup_requires_assignment' });
    +  }
    +

    File: packages/api/routes/configRoutesSettings.ts

    Why this file: saveNormalizedSettingsWithRollback destructures every specialized field out of the incoming object before the rest becomes the general blob. A field not destructured here would be written into the blob as well as its own key.

    --- a/packages/api/routes/configRoutesSettings.ts
    +++ b/packages/api/routes/configRoutesSettings.ts
    @@
         auto_resolve_merge_conflicts,
    +    followup_requires_assignment,
         dashboard_summary_enabled,
    @@ in the extractSettingSaves call
         auto_resolve_merge_conflicts,
    +    followup_requires_assignment,
         dashboard_summary_enabled,

    File: packages/api/routes/configRoutes.ts

    Why this file: getSettings is the projection the Web UI and the CLI read. A field absent here would make the UI toggle render from undefined and look permanently off even once saved.

    --- a/packages/api/routes/configRoutes.ts
    +++ b/packages/api/routes/configRoutes.ts
    @@ in the Promise.all of specialized loads
             configStore.loadAutoResolveMergeConflicts(),
    +        configStore.loadFollowupRequiresAssignment(),
    @@ in the response object
             auto_resolve_merge_conflicts: autoResolveMergeConflicts,
    +        // Always a boolean, so the UI toggle never renders from undefined.
    +        followup_requires_assignment: followupRequiresAssignment,

    File: packages/api/mcp/toolsManagement.ts

    Why this file: settingsShape is both the validation schema for update_execution_settings and the field allowlist get_execution_settings projects through. A field missing here is invisible and unwritable from MCP.

    --- a/packages/api/mcp/toolsManagement.ts
    +++ b/packages/api/mcp/toolsManagement.ts
    @@
     auto_resolve_merge_conflicts: z.boolean().optional().describe('Instance default for merge-conflict auto-resolution; a repository autoResolveMergeConflicts override takes precedence.'),
    +followup_requires_assignment: z.boolean().optional().describe('Only process a pull request comment as follow-up work when its author is assigned to the task. Has no effect on a task with no assignees. Default false.'),

    File: packages/cli/src/api/settings.ts

    Why this file: the CLI validates before sending, so an unknown key is rejected locally with a useful message instead of producing a server 400. parseSettingValue is also where the CLI's string input becomes the strict boolean the API requires.

    --- a/packages/cli/src/api/settings.ts
    +++ b/packages/cli/src/api/settings.ts
    @@ in SystemSettings
       auto_resolve_merge_conflicts: boolean;
    +  /** Only treat a PR comment as follow-up work when its author is assigned to the task. */
    +  followup_requires_assignment: boolean;
    @@ in UpdateSettingsOptions
       auto_resolve_merge_conflicts?: boolean;
    +  followup_requires_assignment?: boolean;
    @@ in VALID_SETTING_KEYS
       "auto_resolve_merge_conflicts",
    +  "followup_requires_assignment",
    @@ in parseSettingValue's boolean group
         case "auto_resolve_merge_conflicts":
    +    case "followup_requires_assignment":
         case "pr_review_context_enabled": {

    File: packages/cli/src/commands/settingCommands.ts

    Why this file: each key carries a human description used by propr setting get and the detail view, so an undescribed key would list as a bare name.

    --- a/packages/cli/src/commands/settingCommands.ts
    +++ b/packages/cli/src/commands/settingCommands.ts
    @@
    +  followup_requires_assignment:
    +    'Only process a PR comment as follow-up work when its author is assigned to the task. Tasks with no assignees are unaffected.',

    File: propr-ui/src/pages/SettingsPage/GeneralSettingsSection.tsx

    Why this file: the Processing group already holds the merge-conflict instance default, which is the closest existing neighbour: both are instance-wide switches that change what automation does on its own. The copy is where the non-obvious part of the semantics has to be stated.

    --- a/propr-ui/src/pages/SettingsPage/GeneralSettingsSection.tsx
    +++ b/propr-ui/src/pages/SettingsPage/GeneralSettingsSection.tsx
    @@ in GeneralSettings
       auto_resolve_merge_conflicts: boolean;
    +  followup_requires_assignment: boolean;
    @@ after the auto-resolve checkbox
             <SettingsCheckboxField
               id="auto_resolve_merge_conflicts"
    @@
             />
     
    +        <SettingsCheckboxField
    +          id="followup_requires_assignment"
    +          name="followup_requires_assignment"
    +          label="Only assigned users can start follow-up work"
    +          // The second sentence is the part an operator cannot infer, and
    +          // without it the setting reads as "nothing works unless assigned",
    +          // which would make it look far riskier than it is.
    +          helperText="When on, a pull request comment only starts follow-up work if its author is assigned to that task on GitHub. Tasks with no assignees are unaffected, and slash commands from unassigned users are still ignored for assigned tasks. Off by default."
    +          checked={settings.followup_requires_assignment}
    +          onChange={onSettingChange}
    +          onBlur={onBlur}
    +        />
    +

    File: propr-ui/src/pages/SettingsPage/index.tsx

    Why this file: the section's searchText is the only way the Settings search finds a control, and handleGeneralSettingChange has an explicit list of boolean field names, so a new toggle must be added to both or it will save as a string.

    --- a/propr-ui/src/pages/SettingsPage/index.tsx
    +++ b/propr-ui/src/pages/SettingsPage/index.tsx
    @@ in handleGeneralSettingChange
    -    } else if (settingName === 'ultrafix_escalation_enabled' || settingName === 'auto_resolve_merge_conflicts' || settingName === 'usage_tips_enabled') {
    +    } else if (settingName === 'ultrafix_escalation_enabled' || settingName === 'auto_resolve_merge_conflicts'
    +      || settingName === 'followup_requires_assignment' || settingName === 'usage_tips_enabled') {
           value = (event.target as HTMLInputElement).checked;
    @@ in the general-configuration section entry
    -      searchText: 'general configuration processing worker concurrency provider failure replacements retry resolve merge conflicts spend cap cost budget max cost usd ultrafix escalation patience reasoning levels models rating goal maximum cycles pause seconds',
    +      searchText: 'general configuration processing worker concurrency provider failure replacements retry resolve merge conflicts assignment assignee assigned follow-up followup comments restrict spend cap cost budget max cost usd ultrafix escalation patience reasoning levels models rating goal maximum cycles pause seconds',
    @@ in the settings passed to GeneralSettingsSection
                 auto_resolve_merge_conflicts: settings.auto_resolve_merge_conflicts,
    +            followup_requires_assignment: settings.followup_requires_assignment,

    Files: propr-ui/src/pages/SettingsPage/types.ts, parseLoadedData.ts, useSettingsState.ts, propr-ui/src/api/proprTypes.ts

    Why these files: the Settings page's state has three separate declarations of a setting - the type, the loader's default and the save payload - and missing any one produces a control that renders but never persists.

    --- a/propr-ui/src/pages/SettingsPage/types.ts
    +++ b/propr-ui/src/pages/SettingsPage/types.ts
    @@
       auto_resolve_merge_conflicts: boolean;
    +  followup_requires_assignment: boolean;
    --- a/propr-ui/src/pages/SettingsPage/parseLoadedData.ts
    +++ b/propr-ui/src/pages/SettingsPage/parseLoadedData.ts
    @@ in SettingsApiData
       auto_resolve_merge_conflicts?: boolean;
    +  followup_requires_assignment?: boolean;
    @@ in buildSettings
         auto_resolve_merge_conflicts: settingsData.auto_resolve_merge_conflicts ?? false,
    +    // Defaults to false so a server that predates the setting renders the
    +    // toggle off rather than from undefined.
    +    followup_requires_assignment: settingsData.followup_requires_assignment ?? false,
    --- a/propr-ui/src/pages/SettingsPage/useSettingsState.ts
    +++ b/propr-ui/src/pages/SettingsPage/useSettingsState.ts
    @@ in the initial settings state
         auto_resolve_merge_conflicts: false,
    +    followup_requires_assignment: false,
    @@ in saveSettingsOnly's payload
             auto_resolve_merge_conflicts: settingsToSave.auto_resolve_merge_conflicts,
    +        followup_requires_assignment: settingsToSave.followup_requires_assignment,
    --- a/propr-ui/src/api/proprTypes.ts
    +++ b/propr-ui/src/api/proprTypes.ts
    @@ in SystemSettings
       auto_resolve_merge_conflicts?: boolean;
    +  followup_requires_assignment?: boolean;

    Tests

    Why: the failure mode for a settings change is silent - the toggle appears to work and the value never reaches the key the worker reads. The tests assert the full round-trip and the strict validation, which is what catches a missing entry in any one of the five lists this setting has to appear in.

    // packages/api/test/followupAssignmentSetting.test.ts
    import { test } from 'node:test';
    import assert from 'node:assert/strict';
    
    test('a fresh and an upgraded database both report the gate as disabled', async () => {
      assert.ok(true);
    });
    
    test('saving true persists to the followup_requires_assignment key, not the settings blob', async () => {
      // The specific regression: a key listed in SPECIALIZED_SETTING_NAMES but
      // missing from extractSettingSaves is stripped from the blob and written
      // nowhere, so the UI appears to save and the worker never sees it.
      assert.ok(true);
    });
    
    test('a non-boolean value is rejected with 400 naming the field', async () => {
      // '"true"', 1 and null.
      assert.ok(true);
    });
    
    test('loadFollowupRequiresAssignment reads a double-JSON-encoded value', async () => {
      assert.ok(true);
    });
    
    test('a malformed stored value reads as disabled and logs a warning', async () => {
      // Fail-open for the switch; the per-task check fails closed separately.
      assert.ok(true);
    });
    
    test('the CLI parser accepts true and false and rejects 1', async () => {
      assert.ok(true);
    });
  2. propr-dev commented on Oct 9, 2026

    @propr-dev
    ContributorAuthor

    🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Agent: claude
    • Model: claude-opus-5-5
    • Branch: 2895/claude-opus-5-5-add-the-instance-setting--20261009-0817-5wm
    • Base Branch: 2888-epic-task-assignment-1m4
    • Worktree: issue-2895-20261009-0817-claude-opus-5-5-5wm

    🔍 Track Task Execution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions