Skip to content

refactor: rename agent-manager TEE/non-TEE to crabshack/legacy_tee#310

Open
walnut-the-cat wants to merge 2 commits into
mainfrom
rename/agent-manager-crabshack-legacy
Open

refactor: rename agent-manager TEE/non-TEE to crabshack/legacy_tee#310
walnut-the-cat wants to merge 2 commits into
mainfrom
rename/agent-manager-crabshack-legacy

Conversation

@walnut-the-cat

Copy link
Copy Markdown

Overview

Renames the internal agent-manager naming from TEE/non-TEE to
legacy_tee/crabshack. Behavior-preserving: identifiers, log/error strings,
comments, and test names only.

AgentManager.is_non_tee is misleading. The pool labeled "non-TEE" is the live
CrabShack path, and CrabShack now places agents on TEE nodes via node_policy,
so "non-TEE" no longer means "not in a TEE".

Scope (internal only)

e.g. ManagerType::{NonTee,Tee} -> {Crabshack,LegacyTee},
AgentManager.is_non_tee -> is_crabshack, is_non_tee_infra() ->
uses_crabshack_infra(), next_available_{non_tee,tee}_manager ->
{crabshack,legacy_tee}. Full map in the diff.

External contracts are unchanged, so this needs no config/DB/admin/frontend
migration: env vars (AGENT_MANAGER_URLS[_TEE], NON_TEE_AGENT_URL, ...) and the
DB/admin key new_agent_with_non_tee_infra are read as-is at the boundary.
Renaming those is a separate follow-up (below).

Verification

No semantic flip (passkey path -> crabshack, bearer path -> legacy_tee; env ->
is_crabshack mapping preserved). cargo fmt, clippy -D warnings, unit tests
(config 26 / services 231 / api 101) green.

Follow-ups (separate PRs)

  • Tier 2: rename the external env vars + new_agent_with_non_tee_infra key (needs
    backward-compat + ansible/admin coordination).
  • Remove dead InfrastructureConfig.non_tee_infra (env NON_TEE_INFRA): no consumers.

Behavior-preserving rename of the internal agent-manager naming axis:
ManagerType::{NonTee,Tee} -> {Crabshack,LegacyTee}, is_non_tee -> is_crabshack,
is_non_tee_infra() -> uses_crabshack_infra(),
next_available_{non_tee,tee}_manager -> {crabshack,legacy_tee},
NonTeeInstanceResponse -> CrabshackInstanceResponse, and related locals/comments/tests.

The "non-TEE" pool is the live CrabShack path (which now does TEE node placement
via node_policy); the "TEE" pool is the separate Legacy TEE backend. Only internal
identifiers, log/error strings, comments, and test names change. External contracts
(env vars + the new_agent_with_non_tee_infra DB/admin key) are read as-is, so no
config/DB/admin/frontend migration is needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 17:13

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates the codebase terminology by renaming references to 'non-TEE' and 'TEE' to 'crabshack' and 'legacy_tee' respectively. This includes renaming configuration fields (such as non_tee_agent_url_pattern to crabshack_agent_url_pattern and is_non_tee to is_crabshack), updating local variables, and adapting documentation, comments, and test names to align with the new naming convention. There are no review comments provided, so I have no feedback to offer.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Copilot AI 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.

Pull request overview

This PR refactors internal agent-manager terminology to replace TEE/non-TEE with clearer, behavior-preserving names: legacy_tee (bearer) and crabshack (passkey/“claws”), while keeping external contracts (env vars, DB/admin JSON field names) unchanged.

Changes:

  • Renames manager typing and routing helpers across the services layer (ManagerType, selection helpers, log strings) to crabshack / legacy_tee.
  • Updates config structures to use is_crabshack and crabshack_agent_url_pattern while still reading legacy env vars at the boundary.
  • Updates API routes and test/documentation references to the new internal terminology.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
crates/services/src/system_configs/ports.rs Updates admin/system-config documentation to describe crabshack vs legacy_tee routing while preserving the DB/admin field name.
crates/services/src/agent/service.rs Renames manager-type logic, routing decisions, logs, and tests to crabshack/legacy_tee terminology.
crates/services/src/agent/ports.rs Updates trait/docs references for gateway session behavior to crabshack terminology.
crates/config/src/lib.rs Renames agent manager config fields to is_crabshack and crabshack_agent_url_pattern, keeping env var boundaries intact.
crates/api/tests/upgrade_check_tests.rs Updates integration-test documentation/comments to reference crabshack upgrade checks.
crates/api/tests/common.rs Wires the renamed crabshack_agent_url_pattern into test server setup.
crates/api/src/routes/agents.rs Uses crabshack_infra naming in the create-instance route and updates related comments.
crates/api/src/main.rs Passes crabshack_agent_url_pattern into service initialization.
crates/api/src/bin/task_worker.rs Passes crabshack_agent_url_pattern into worker service initialization.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/config/src/lib.rs Outdated
Comment thread crates/config/src/lib.rs
Comment thread crates/config/src/lib.rs Outdated
Comment thread crates/api/src/routes/agents.rs Outdated
@claude

claude Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review — PR #310: rename agent-manager TEE/non-TEE → crabshack/legacy_tee

Read the full diff across all 9 files. This is a behavior-preserving identifier/string/comment rename. No control flow, no boolean polarity flips, no API/DB/env boundary changes. No critical issues found.

Verified for safety

  • Boolean polarity preserved end-to-end: is_non_tee:falseis_crabshack:false (legacy_tee/bearer) and is_non_tee:trueis_crabshack:true (crabshack/passkey) consistently. The AGENT_MANAGER_URLS_TEEis_crabshack:false and AGENT_MANAGER_URLSis_crabshack:true mappings in AgentConfig::default() match the originals.
  • No rolling-deploy / state-migration risk from the renamed serde field. AgentManager derives Deserialize and is_crabshack carries serde(default), but the struct is only ever constructed from env vars (config/src/lib.rs:516,542,558) — it is never deserialized from any persisted JSON/config store. So the field-name change is_non_teeis_crabshack cannot silently default old data into the wrong pool.
  • External contracts correctly left untouched: the DB/admin key new_agent_with_non_tee_infra, and env vars NON_TEE_AGENT_URL / NON_TEE_INFRA / AGENT_MANAGER_URLS[_TEE] are read as-is at the boundary. The AgentHostingConfig.new_agent_with_non_tee_infra field name is preserved with a clarifying doc comment — keeps the admin-API/DB JSON contract intact.
  • Round-robin counters, endpoint selection (/ssh vs /instances/{name}), and SSH field selection (command vs ssh_command) are renamed without altering which branch maps to which manager type.

Minor (non-blocking) — stragglers the rename missed

The PR description says comments were renamed too, but a few non-TEE comments remain where they describe the now-renamed concept (not the external contract):

  • crates/api/src/routes/oauth.rs:975-976, 1300-1301, 1421-1422For non-TEE mode: set up gateway session ... still uses the old term. Worth aligning to crabshack for consistency, but harmless.

(The non_tee references in system_configs_tests.rs, and InfrastructureConfig.non_tee_infra in config/src/lib.rs, are intentionally retained per the PR's stated Tier-2 / dead-code follow-ups.)

✅ Approved — clean rename, externally safe, no logic changes. Suggest sweeping the residual oauth.rs comments before merge or in the follow-up.

- default_crabshack_agent_url -> default_crabshack_agent_url_pattern: it returns the
  detection pattern (from NON_TEE_AGENT_URL), not a URL, and feeds crabshack_agent_url_pattern
  (Copilot).
- agents.rs: tighten the gateway-cookie comment to match the crabshack_infra gating (Copilot).
- Sweep residual "non-TEE" comments to crabshack/legacy_tee in oauth.rs, agent/ports.rs, and
  system_configs/ports.rs (claude review). The dead InfrastructureConfig/NON_TEE_INFRA axis is
  left for its separate follow-up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@walnut-the-cat

Copy link
Copy Markdown
Author

Addressed review feedback in e4eec97:

  • Copilot: renamed default_crabshack_agent_urldefault_crabshack_agent_url_pattern (it returns the detection pattern, not a URL) and tightened the gateway-cookie comment in agents.rs to match the crabshack_infra gating (behavior unchanged).
  • claude review: swept the residual non-TEE comments to crabshack/legacy_tee in oauth.rs (3 spots), services/agent/ports.rs, and system_configs/ports.rs.

Left for the stated follow-up: the dead InfrastructureConfig.non_tee_infra (env NON_TEE_INFRA) axis and the external Tier-2 names (new_agent_with_non_tee_infra, env vars).

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.

2 participants