Skip to content

fix(settings): say which runtime features the app withholds, and why - #165

Merged
devswha merged 1 commit into
mainfrom
fix/surface-withheld-runtime-features
Sep 16, 2026
Merged

devswha merged 1 commit into
mainfrom
fix/surface-withheld-runtime-features

Conversation

@devswha

@devswha devswha commented Sep 16, 2026

Copy link
Copy Markdown
Owner

Refs #161.

The gap

Every app session runs through applyGjcToolSettingsPolicy(), which overrides four runtime settings:

settings.override('astEdit.enabled', false);
settings.override('tools.discoveryMode', 'off');
settings.override('mcp.discoveryMode', false);
settings.override('mcp.enableProjectConfig', false);

Those overrides are correct as a security boundary and the inline comments justify them well. They stay. The problem is that nothing surfaced them.

A user with MCP servers configured for the GJC CLI sees them load there:

~/.gjc/logs/gjc.2026-09-17.log   (CLI process)
  14× GJC plugin MCP connect failed  path=mcp:stylegallery
      GJC plugin MCP connect failed  path=mcp:stylegallery-material

and finds nothing at all in the app — no error, no badge, no disabled state. Searching the UI for any acknowledgement turned up exactly one stray comment:

$ grep -rnE 'discoveryMode|mcp\.|MCP' src/components/ src/i18n/locales/en/
src/components/sidebar/view/SidebarModals.tsx:53:
  // Settings expects project identity/path fields ... and local-scope MCP config.

Settings implies configurability that does not exist. "Works in the CLI, missing in the app, no error message" is an unanswerable support question.

What this adds

The Automation tab now ends with a read-only block naming each withheld feature and the reason for it:

Feature Reason shown
MCP servers Servers from your GJC settings and a project .mcp.json are not loaded, so tools the app never chose cannot reach a session.
Tool discovery Sessions cannot activate additional tools at runtime; the app-selected set is the whole set.
AST edit It only previews rewrites and applies them through a tool the app does not expose, so it would advertise edits a session could never commit.

Reports, not controls — there is nothing to switch, because a session cannot switch them either. A test asserts the block renders no button, input or select, so a later edit cannot quietly add one.

ast_edit being off is not theoretical: the 681-turn session measured for #159 hit Edit rejected: N anchors do not match the current file 26 times.

i18n

automation.withheld* — 8 keys across all 10 locales, inserted in place without reformatting the surrounding JSON.

Verification

bun test AutomationSettingsTab.dom.bun.test.tsx     14 pass  0 fail   (11 existing + 3 new)
node --test scripts/check-locale-parity.test.mjs     2 pass  0 fail
npx tsc -p tsconfig.json --noEmit                   clean
npx eslint <changed files>                          clean

New tests: each feature renders with its reason; the block offers no control; and the eight wording keys have parity across all ten locales.

Scope

This closes the surfacing half of #161. The issue also asks for a docs/ note on the app-vs-CLI capability delta — left for a follow-up so this stays a UI change.

Every app session overrides four runtime settings - `mcp.discoveryMode`,
`mcp.enableProjectConfig`, `tools.discoveryMode` and `astEdit.enabled`. The
overrides are the right call and they stay; saying nothing about them was not.

A user whose MCP servers work in the GJC CLI finds them simply absent in the
app: no error, no badge, no explanation. The only mention of MCP anywhere in
src/components/ was a stray comment about dropdown labels, while Settings
implied configurability that does not exist. "Works in the CLI, missing in the
app, no error message" is an unanswerable support question.

Automation now ends with a read-only block naming each withheld feature and the
reason for it. Reports, not controls: there is nothing to switch, because a
session cannot switch them either - and a test asserts the block renders no
control, so a later edit cannot quietly add one.

Refs #161
@devswha
devswha merged commit 93d7aff into main Sep 16, 2026
6 checks passed
@devswha
devswha deleted the fix/surface-withheld-runtime-features branch September 16, 2026 17:50
devswha added a commit that referenced this pull request Sep 17, 2026
…e contract

The app never refused a user's own MCP servers - it only claimed to. With
the runtime's conventional autoload, the servers registered with
`gjc mcp add` (`<agentDir>/mcp.json`) connect before an app session exists
and their tools are always-on, past the explicit `toolNames` and with
discovery off. The Settings row added in #165 said the opposite, in ten
languages, and #161 repeated it.

Owner decision (2026-09-18): keep exactly that split. User scope loads as
in the CLI; a project's own `.gjc/mcp.json` never does. The runtime reads
an unset `mcp.enableProjectConfig` as true, so the app's override is the
load-bearing half and is now described as such.

- `gjc-mcp-autoload.bun.test.ts` pins both scopes against the real SDK
  with a real stdio server: the runtime alone loads both; under the app
  policy the user-scope tool is active and executable while the project
  one is absent; opting out of the autoload is what would remove it.
- The identity fixture in the contract suite asserts a top-level session
  keeps the autoload and a delegated child opts out.
- Settings > Automation > Withheld: the row is now "Project MCP servers"
  and says what loads and what does not (all ten locales).
- `GJC-LIVE-SPEC.md` gains an "MCP servers" section.

Closes #161.
devswha added a commit that referenced this pull request Sep 17, 2026
…e contract (#170)

* fix(settings): say that user-scope MCP servers load, and pin the scope contract

The app never refused a user's own MCP servers - it only claimed to. With
the runtime's conventional autoload, the servers registered with
`gjc mcp add` (`<agentDir>/mcp.json`) connect before an app session exists
and their tools are always-on, past the explicit `toolNames` and with
discovery off. The Settings row added in #165 said the opposite, in ten
languages, and #161 repeated it.

Owner decision (2026-09-18): keep exactly that split. User scope loads as
in the CLI; a project's own `.gjc/mcp.json` never does. The runtime reads
an unset `mcp.enableProjectConfig` as true, so the app's override is the
load-bearing half and is now described as such.

- `gjc-mcp-autoload.bun.test.ts` pins both scopes against the real SDK
  with a real stdio server: the runtime alone loads both; under the app
  policy the user-scope tool is active and executable while the project
  one is absent; opting out of the autoload is what would remove it.
- The identity fixture in the contract suite asserts a top-level session
  keeps the autoload and a delegated child opts out.
- Settings > Automation > Withheld: the row is now "Project MCP servers"
  and says what loads and what does not (all ten locales).
- `GJC-LIVE-SPEC.md` gains an "MCP servers" section.

Closes #161.

* test(gjc): record the MCP autoload test as an engine test

The engine manifest is the list `npm test` enforces for `server/gjc-*`;
a file missing from it fails the suite on purpose. The new scope test
belongs with the adapter it pins.

---------

Co-authored-by: devswha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant