Private
Public Access
0
0

fixes to autonomous tier 2 workspace setup

This commit is contained in:
2026-07-05 13:04:00 -04:00
parent 98977f5c5e
commit 344cd953ce
+15 -11
View File
@@ -68,16 +68,20 @@ if ($PSCmdlet.ShouldProcess("Bootstrap Tier 2 clone at $Tier2ClonePath")) {
# (deny-all + allowlist for the sandbox dirs + the tier2-autonomous
# agent's permission block). The agent's `permission` overrides the
# top-level for that agent's tool calls.
# NOTE: parse with -AsHashtable because the fragment contains
# case-variant duplicate keys at the same level (e.g. "*C:/tmp*"
# and "*c:/tmp*") inside the bash permission block. The default
# ConvertFrom-Json builds a case-insensitive PSCustomObject and
# errors on those duplicates; -AsHashtable is case-sensitive.
$cloneConfig = "$Tier2ClonePath\opencode.json"
$fragment = Get-Content "$MainRepoPath\conductor\tier2\opencode.json.fragment" -Raw | ConvertFrom-Json
$fragment = Get-Content "$MainRepoPath\conductor\tier2\opencode.json.fragment" -Raw | ConvertFrom-Json -AsHashtable
if (Test-Path $cloneConfig) {
$existing = Get-Content $cloneConfig -Raw | ConvertFrom-Json
if (-not $existing.agent) { $existing | Add-Member -MemberType NoteProperty -Name agent -Value ([PSCustomObject]@{}) }
$existing.agent | Add-Member -MemberType NoteProperty -Name "tier2-autonomous" -Value $fragment.agent."tier2-autonomous" -Force
if (-not $existing.permission) { $existing | Add-Member -MemberType NoteProperty -Name permission -Value ([PSCustomObject]@{}) }
$existing.permission = $fragment.permission
$existing | Add-Member -MemberType NoteProperty -Name default_agent -Value "tier2-autonomous" -Force
$existing | Add-Member -MemberType NoteProperty -Name model -Value $fragment.model -Force
$existing = Get-Content $cloneConfig -Raw | ConvertFrom-Json -AsHashtable
if (-not $existing.ContainsKey('agent')) { $existing['agent'] = @{} }
$existing['agent']['tier2-autonomous'] = $fragment['agent']['tier2-autonomous']
$existing['permission'] = $fragment['permission']
$existing['default_agent'] = 'tier2-autonomous'
$existing['model'] = $fragment['model']
$existing | ConvertTo-Json -Depth 10 | Set-Content $cloneConfig
} else {
Copy-Item -Force "$MainRepoPath\conductor\tier2\opencode.json.fragment" $cloneConfig
@@ -94,14 +98,14 @@ if ($PSCmdlet.ShouldProcess("Bootstrap Tier 2 clone at $Tier2ClonePath")) {
# The fix: launch the MCP server from the clone's path with the
# clone's PYTHONPATH, and replace the clone's mcp_paths.toml with
# an empty one so the clone's MCP server has no extra_dirs.
if ($existing.mcp -and $existing.mcp.'manual-slop') {
$existing.mcp.'manual-slop'.command = @(
if ($existing.ContainsKey('mcp') -and $existing['mcp'].ContainsKey('manual-slop')) {
$existing['mcp']['manual-slop']['command'] = @(
"$env:USERPROFILE\scoop\apps\uv\current\uv.exe",
"run",
"python",
"$Tier2ClonePath\scripts\mcp_server.py"
)
$existing.mcp.'manual-slop'.environment.PYTHONPATH = "$Tier2ClonePath\src"
$existing['mcp']['manual-slop']['environment']['PYTHONPATH'] = "$Tier2ClonePath\src"
$existing | ConvertTo-Json -Depth 10 | Set-Content $cloneConfig
}
$cloneMcpPaths = "$Tier2ClonePath\mcp_paths.toml"