Agent Workspace Mount After Config
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user