Skip to content

feat(mcp): expose current environment diagnostics - #8726

Closed
juliusmarminge wants to merge 6 commits into
t3code/codex-turn-mappingfrom
agents/mcp-environment/read
Closed

juliusmarminge wants to merge 6 commits into
t3code/codex-turn-mappingfrom
agents/mcp-environment/read

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Aug 30, 2026

Copy link
Copy Markdown
Member

Problem

Agents could not inspect the identity or safe operational state of the T3 environment backing their current conversation without relying on unrelated settings payloads.

Change

Add t3_environment_read, backed by the existing environment, provider registry, and settings services. It returns a paged provider-health summary, explicit safe capabilities, and a narrow server-owned preference projection.

Behavior

The tool is current-environment only, read-only, and closed-world. It reads cached provider state without refreshing, installing, or authenticating providers. Human-readable diagnostics are Unicode-safe and bounded; credentials, provider configuration, model inventories, paths, raw diagnostics, and administrative fields never enter the result. Environment mismatch is checked before provider/settings reads, and finite public failure codes do not expose internal causes.

Focused validation

  • allowlisted service projection, capability/mismatch denial, unavailable-service, and Unicode-bound tests
  • production HTTP tools/list root-object and annotation coverage
  • Claude read-only allowlist and shared presentation coverage
  • 6 focused files / 18 tests passed across the complete native stack
  • server and contracts scoped typechecks, targeted formatting, and git diff --check

Dependency

Bottom layer of native stack 8782, based on t3code/codex-turn-mapping at the pinned rollout target. #8728 adds the dependent preference mutation.

Implemented by GPT-5.6-Sol via Codex in T3 Code.

@coderabbitai

coderabbitai Bot commented Aug 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: fce18fe1-806e-416c-b85d-d5ae444adbf7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Warning

Your free Security trial is over. An organization admin can activate Security or dismiss this notice.


Comment @coderabbitai help to get the list of available commands.

@juliusmarminge
juliusmarminge marked this pull request as ready for review August 30, 2026 01:55
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Aug 30, 2026

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the new EnvironmentMcpService, its toolkit wiring, and the environmentMcp contract against the Effect service conventions. Module layout (namespace imports of Effect subpaths, inline Context.Service interface, make then layer, dependencies acquired via yield*) looks right; two findings on the error model.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/EnvironmentMcpService.ts Outdated
Comment thread packages/contracts/src/environmentMcp.ts Outdated
@github-actions

github-actions Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Thread transfer impact

⚠️ The latest CI run did not produce a thread transfer result for 512391d.

This comment will update automatically after the next completed run.

@macroscopeapp

macroscopeapp Bot commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR introduces and registers a new authenticated MCP capability that exposes environment, provider health, authentication summaries, and server-owned preferences to provider sessions. Its read-only and allowlisted design limits risk, but the new production data boundary and session-tool availability require human review.

Notes:

  • Diff unchanged. Approvability was decided on eligibility alone.

No code changes detected at 512391d. Prior analysis still applies.

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

@juliusmarminge
juliusmarminge force-pushed the agents/mcp-environment/read branch from 0a9b7e7 to 26f239a Compare August 30, 2026 17:28
@juliusmarminge
juliusmarminge changed the base branch from agents/mcp-controls/base-490318a to t3code/codex-turn-mapping August 30, 2026 17:28
@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
Comment thread apps/server/src/mcp/EnvironmentMcpService.ts Outdated

@macroscopeapp macroscopeapp Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One retained finding: EnvironmentMcpFailure still drops the underlying failure when the service wraps a real error. See the inline comment.

Posted via Macroscope — Effect Service Conventions

Comment thread apps/server/src/mcp/EnvironmentMcpService.ts Outdated
@github-actions github-actions Bot removed the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Aug 30, 2026
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-environment/read branch from c24bb8c to 0775269 Compare August 30, 2026 20:13
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-environment/read branch from 0775269 to 000d343 Compare September 5, 2026 06:12

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is ON, but a cloud agent failed to start.

Reviewed by Cursor Bugbot for commit 000d343. Configure here.

Comment thread apps/server/src/mcp/EnvironmentMcpService.test.ts Outdated
@juliusmarminge
juliusmarminge force-pushed the agents/mcp-environment/read branch from 0982610 to 512391d Compare September 7, 2026 18:28
@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@juliusmarminge

Copy link
Copy Markdown
Member Author

Superseded as the active MCP proposal by #10560 in the rebuilt MCP stack, following the maintainer request to review thin service wrappers separately from service hardening.

This is not a full feature-parity replacement. Updates require a live full-access/default caller under the existing ThreadCommandExecutor. Provider configuration, secrets and admin controls are not exposed. No new settings store or lock service.

Closing this mixed proposal without merging. The remote branch agents/mcp-environment/read and exact head 512391db91759dc9f4a7b1e93ca3075fe1e90dea are retained so the service changes can be extracted for separate review later.

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant