Skip to content

feat(gsd-extension): add opt-in context-pressure wrapup disable#3411

Open
gunish wants to merge 1 commit intogsd-build:mainfrom
gunish:feat/context-pressure-wrapup-optout
Open

feat(gsd-extension): add opt-in context-pressure wrapup disable#3411
gunish wants to merge 1 commit intogsd-build:mainfrom
gunish:feat/context-pressure-wrapup-optout

Conversation

@gunish
Copy link
Copy Markdown

@gunish gunish commented Apr 1, 2026

TL;DR

What: Add an opt-in auto_supervisor.disable_context_pressure_wrapup preference that suppresses the context-pressure continue-here / wrap-up monitor.
Why: Some repos prefer to handle context pressure by splitting work into smaller follow-up tasks instead of steering the current unit toward closeout.
How: Extend AutoSupervisorConfig, resolve the new flag with a safe default of false, and skip only the continue-here monitor in auto-timers while leaving soft/idle/hard timeout supervision unchanged.

What

This PR adds a small opt-in preference to the GSD auto supervisor:

auto_supervisor:
  disable_context_pressure_wrapup: true

When enabled, startUnitSupervision() does not install the context-pressure continue-here monitor that emits the gsd-auto-wrapup message ("**CONTEXT BUDGET WARNING — wrap up this unit now.**").

The rest of supervision remains intact:

  • soft timeout warning
  • idle watchdog
  • hard timeout recovery/pause

Files changed:

  • src/resources/extensions/gsd/preferences-types.ts
  • src/resources/extensions/gsd/preferences-models.ts
  • src/resources/extensions/gsd/auto-timers.ts
  • src/resources/extensions/gsd/docs/preferences-reference.md
  • src/resources/extensions/gsd/templates/PREFERENCES.md
  • src/resources/extensions/gsd/tests/auto-supervisor.test.mjs
  • src/resources/extensions/gsd/tests/preferences.test.ts

Why

The existing context-pressure monitor is a sensible default, but it is not the right fit for every repository.

In some repos, the better behavior under rising context pressure is:

  • split work into smaller follow-up tasks earlier
  • preserve timeout-based safety rails
  • avoid context pressure itself becoming a strong closeout steer

This PR makes that behavior available explicitly without changing the default experience for existing users.

Refs #3406.

How

Implementation details:

  • add disable_context_pressure_wrapup?: boolean to AutoSupervisorConfig
  • have resolveAutoSupervisorConfig() return the flag with a strict default of false
  • in auto-timers.ts, short-circuit only the continue-here setup when the flag is enabled
  • document the preference in the reference docs and preferences template
  • add config-backed tests that isolate project/global preference loading in temp directories and assert that only the continue-here timer is suppressed

I intentionally kept validation permissive and did not broaden schema cleanup in this PR. The goal is a small, focused behavior change with minimal blast radius.

Verification

  • npm run typecheck:extensions
  • targeted compiled tests for:
    • auto-supervisor.test.mjs
    • preferences.test.ts
  • node --import ./src/resources/extensions/gsd/tests/resolve-ts.mjs --experimental-strip-types --experimental-test-isolation=process --test src/resources/extensions/gsd/tests/integration/continue-here.test.ts
  • npm run build

Notes

  • This PR is intentionally opt-in only.
  • It does not change default timeout values.
  • It does not remove or alter the existing continue-here behavior unless the new preference is explicitly set.
  • AI-assisted contribution.

@github-actions github-actions bot added the enhancement New feature or request label Apr 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

🔴 PR Risk Report — CRITICAL

Files changed 7
Systems affected 2
Overall risk 🔴 CRITICAL

Affected Systems

Risk System
🔴 critical Auto Engine
🟠 high GSD Workflow
File Breakdown
Risk File Systems
🔴 src/resources/extensions/gsd/auto-timers.ts Auto Engine
🟠 src/resources/extensions/gsd/templates/PREFERENCES.md GSD Workflow
src/resources/extensions/gsd/docs/preferences-reference.md (unclassified)
src/resources/extensions/gsd/preferences-models.ts (unclassified)
src/resources/extensions/gsd/preferences-types.ts (unclassified)
src/resources/extensions/gsd/tests/auto-supervisor.test.mjs (unclassified)
src/resources/extensions/gsd/tests/preferences.test.ts (unclassified)

⚠️ Critical risk — please verify: state persistence, auth token lifecycle, agent loop race conditions, RPC protocol compatibility.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant