Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/spawn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ resolve_team() {
project_sql_in=$(agmsg_project_sql_in_list "$PROJECT")
for config_file in "$TEAMS_DIR"/*/config.json; do
[ -f "$config_file" ] || continue
cfg_sql=$(printf '%s' "$config_file" | sed "s/'/''/g")
# readfile() needs a native-Windows path — agmsg_sql_readfile_path converts and SQL-escapes it.
cfg_sql=$(agmsg_sql_readfile_path "$config_file")
team_name=$(agmsg_sqlite_mem \
"SELECT json_extract(CAST(readfile('$cfg_sql') AS TEXT), '\$.name');")
# Does any agent in this team have a registration for PROJECT (any type)?
Expand Down
11 changes: 11 additions & 0 deletions tests/test_spawn.bats
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,17 @@ YAML
[[ "$output" == *"reviewer"* ]]
}

@test "spawn: resolve_team reads team configs via agmsg_sql_readfile_path (Windows-native sqlite3 regression)" {
# sqlite3.exe (native Windows) cannot readfile() a POSIX-form path: it returns
# NULL, the JSON probe yields no rows, and spawn dies with 'no team is
# registered' even though join succeeded. The helper cygpath-converts and
# SQL-escapes; a bare sed-escape here reintroduces the bug. No portable
# runtime probe exists (it needs a native sqlite3 plus a POSIX-form tmpdir),
# so assert the source directly.
run grep -F 'cfg_sql=$(agmsg_sql_readfile_path "$config_file")' "$SCRIPTS/spawn.sh"
[ "$status" -eq 0 ]
}

@test "spawn: codex boot prompt uses the \$ skill prefix, not / (#283)" {
# codex invokes a skill with \$<cmd>, not Claude Code's /<cmd>. The boot script
# must carry \$<cmd> actas, never /<cmd> actas. (%q escapes the space as "\ ",
Expand Down