Agent Workspace Mount After Config

This commit is contained in:
Raven Scott
2026-04-22 02:57:42 -04:00
parent 6ee7cfcb57
commit 5eb559c554
10 changed files with 59 additions and 7 deletions
+21
View File
@@ -4427,6 +4427,17 @@ async function bareAgentRunSetupOnly(ctx, argv0) {
const home = bareAgentResolveHome(ctx)
const paths = bareAgentPaths(home)
let { config } = await bareAgentLoadOrCreateConfig(ctx, paths)
if (!bareAgentCanPlainSetup(ctx)) {
bareAgentErr(
ctx,
argv0 +
': --setup / --config needs an interactive TTY. Edit ' +
paths.config +
' manually.'
)
ctx.exitCode = 1
return
}
let suspended = false
try {
if (typeof ctx.suspendReplForSubprocess === 'function') {
@@ -4442,11 +4453,21 @@ async function bareAgentRunSetupOnly(ctx, argv0) {
ctx.resumeReplAfterSubprocess()
}
}
try {
await bareAgentEnsureWorkspace(ctx, paths)
await bareAgentEnsureSkillTemplates(ctx, paths)
} catch {
bareAgentErr(
ctx,
argv0 + ': could not seed ~/.agent/workspace from /share/agent-workspace (check system image)'
)
}
try {
if (ctx.vfs?.chmod) await ctx.vfs.chmod(paths.config, 0o600)
} catch {
/* ignore */
}
ctx.exitCode = 0
void config
}