cleanup: remove dead USER_TYPE fast mode and setup branches (#315)

This commit is contained in:
KRATOS
2026-04-04 11:45:28 +05:30
committed by GitHub
parent 5be5387096
commit bd4daa3ee7
3 changed files with 165 additions and 46 deletions

View File

@@ -6,7 +6,6 @@ import {
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
logEvent,
} from 'src/services/analytics/index.js'
import { isAntEmployee } from 'src/utils/buildConfig.js'
import { getCwd } from 'src/utils/cwd.js'
import { checkForReleaseNotes } from 'src/utils/releaseNotes.js'
import { setCwd } from 'src/utils/Shell.js'
@@ -335,19 +334,6 @@ export async function setup(
// overhead. NOT an early-return: the --dangerously-skip-permissions safety
// gate, tengu_started beacon, and apiKeyHelper prefetch below must still run.
if (!isBareMode()) {
if (isAntEmployee()) {
// Prime repo classification cache for auto-undercover mode. Default is
// undercover ON until proven internal; if this resolves to internal, clear
// the prompt cache so the next turn picks up the OFF state.
void import('./utils/commitAttribution.js').then(async m => {
if (await m.isInternalModelRepo()) {
const { clearSystemPromptSections } = await import(
'./constants/systemPromptSections.js'
)
clearSystemPromptSections()
}
})
}
if (feature('COMMIT_ATTRIBUTION')) {
// Dynamic import to enable dead code elimination (module contains excluded strings).
// Defer to next tick so the git subprocess spawn runs after first render
@@ -414,32 +400,6 @@ export async function setup(
process.exit(1)
}
if (
isAntEmployee() &&
// Skip for Desktop's local agent mode — same trust model as CCR/BYOC
// (trusted Anthropic-managed launcher intentionally pre-approving everything).
// Precedent: permissionSetup.ts:861, applySettingsChange.ts:55 (PR #19116)
process.env.CLAUDE_CODE_ENTRYPOINT !== 'local-agent' &&
// Same for CCD (Claude Code in Desktop) — apps#29127 passes the flag
// unconditionally to unlock mid-session bypass switching
process.env.CLAUDE_CODE_ENTRYPOINT !== 'claude-desktop'
) {
// Only await if permission mode is set to bypass
const [isDocker, hasInternet] = await Promise.all([
envDynamic.getIsDocker(),
env.hasInternetAccess(),
])
const isBubblewrap = envDynamic.getIsBubblewrapSandbox()
const isSandbox = process.env.IS_SANDBOX === '1'
const isSandboxed = isDocker || isBubblewrap || isSandbox
if (!isSandboxed || hasInternet) {
// biome-ignore lint/suspicious/noConsole:: intentional console output
console.error(
`--dangerously-skip-permissions can only be used in Docker/sandbox containers with no internet access but got Docker: ${isDocker}, Bubblewrap: ${isBubblewrap}, IS_SANDBOX: ${isSandbox}, hasInternet: ${hasInternet}`,
)
process.exit(1)
}
}
}
if (process.env.NODE_ENV === 'test') {