Skip to content

Workspace enrollment can permanently remove unrelated core tool authority #1740

Closed

Description

@ChrisJBurns

Summary

Completing workspace-tool enrollment can replace the session's entire durable tool authority with only the enrolled broker catalogue's tool names. Unrelated core tools, including Shell, then disappear from the model-visible tool surface and remain absent across resume and fork.

Permission mode and operator posture cannot restore the missing tools because the persisted bound authority is applied as a stricter request-time filter.

Observed behavior

  1. Start an ordinary filesystem session where Shell is available.
  2. Complete workspace-tool enrollment with a catalogue that does not contain Shell.
  3. On the next request, Shell is no longer advertised.
  4. Exit and resume the session: Shell remains absent.
  5. Fork the session: the fork also lacks Shell.
  6. Starting mecatui with --mode accept-edits --posture auto does not restore it. Diagnostics report the persisted session mode, while the deployment-wide Bash capability can still appear enabled.

Observed with:

mecatui v0.0.39-6-g68aa40e57
embedded server
permission mode: default

Expected behavior

Workspace enrollment should atomically replace the broker-owned tool bundle without attenuating unrelated core, delegation, memory, skill, global MCP, or client MCP tools that remain present in the rebuilt session catalog.

Resume and fork should preserve the resulting complete authority. Deliberately attenuated sessions must still remain unable to widen their own authority.

Likely cause

internal/adapter/server/workspace_enrollment.go obtains only the enrolled catalogue's names and passes them to the aggregate:

toolNames := result.Catalogue.ToolNames()
// ...
sess.CompleteWorkspaceEnrollment(pending, toolNames)

engine/session/workspace_enrollment.go then replaces the complete generic capability list:

exact := s.Authority.Clone()
exact.CapabilitySet.Tools = append([]string(nil), exactTools...)
s.Authority = exact

The rebuilt engine catalog is broader than that broker-only list: composition registers core tools and other session tools alongside the enrolled wrappers. At request construction, engine/agent/loop.go applies authoritySpecs, so every catalog tool absent from the persisted broker-only list is removed.

Forking copies the source authority in internal/adapter/server/placement_successor.go, making the attenuation durable in successors as well.

Suggested direction

Do not solve this by blindly unioning the previous authority with the new broker list; that would retain stale broker tools during replacement.

Instead, make the rebuilt session-engine path return or otherwise project the exact final catalog registration names after composition. Persist that complete set only after the replacement engine has been successfully built. This preserves atomic broker replacement while retaining unrelated tools that remain in the actual catalog.

Regression coverage

  • Core Shell, file, delegation, memory, and skill tools remain after initial workspace enrollment.
  • A broker refresh removes stale broker-owned names and installs the exact replacement bundle.
  • Global MCP and client MCP tools remain when still present in the rebuilt catalog.
  • Persisted authority exactly matches the final built catalog.
  • Resume retains the corrected complete authority.
  • Fork retains the corrected complete authority.
  • Deliberately attenuated sessions cannot regain excluded tools through enrollment, resume, fork, mode, or posture.
  • Per-session diagnostics distinguish globally supported Bash from a session tool removed by mode, authority, or mount availability.

Relevant code

  • internal/adapter/server/workspace_enrollment.go
  • engine/session/workspace_enrollment.go
  • engine/agent/authority_disclosure.go
  • engine/agent/loop.go
  • internal/adapter/server/placement_successor.go
  • internal/app/catalog.go

Activity

  1. self-assigned this
    on Sep 22, 2026
  2. jhrozek commented on Oct 19, 2026

    @jhrozek
    Contributor

    Fixed on main by #1809 (2ad7d94, merged 2026-10-15). Workspace enrollment now replaces only the prior broker-owned tool bundle, tracked by a persisted broker-key ledger, so unrelated core tools such as Shell keep their authority across enrollment, resume and fork. Closing.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions