Compare commits

..

1 commit

Author SHA1 Message Date
Agent
da3df3e39a fix: feat(20a): disinto hire-an-agent subcommand + retrofit dev-qwen (#83)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
2026-04-01 07:19:33 +00:00

View file

@ -2431,8 +2431,9 @@ disinto_hire_an_agent() {
local user_token="" local user_token=""
if [ "$user_exists" = true ]; then if [ "$user_exists" = true ]; then
# Try to get token for the new user # Try to get token for the new user
# Note: user_pass was set in Step 1; for existing users this will fail (unknown password)
user_token=$(curl -sf -X POST \ user_token=$(curl -sf -X POST \
-u "${agent_name}:agent-pass" \ -u "${agent_name}:${user_pass}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
"${forge_url}/api/v1/users/${agent_name}/tokens" \ "${forge_url}/api/v1/users/${agent_name}/tokens" \
-d "{\"name\":\".profile-repo-token\",\"scopes\":[\"repository\"]}" 2>/dev/null \ -d "{\"name\":\".profile-repo-token\",\"scopes\":[\"repository\"]}" 2>/dev/null \
@ -2441,7 +2442,7 @@ disinto_hire_an_agent() {
if [ -z "$user_token" ]; then if [ -z "$user_token" ]; then
# Try listing existing tokens # Try listing existing tokens
user_token=$(curl -sf \ user_token=$(curl -sf \
-u "${agent_name}:agent-pass" \ -u "${agent_name}:${user_pass}" \
"${forge_url}/api/v1/users/${agent_name}/tokens" 2>/dev/null \ "${forge_url}/api/v1/users/${agent_name}/tokens" 2>/dev/null \
| jq -r '.[0].sha1 // empty') || user_token="" | jq -r '.[0].sha1 // empty') || user_token=""
fi fi
@ -2483,13 +2484,14 @@ disinto_hire_an_agent() {
rm -rf "$clone_dir" rm -rf "$clone_dir"
mkdir -p "$clone_dir" mkdir -p "$clone_dir"
# Build clone URL # Build clone URL (unauthenticated version for display)
local clone_url="${forge_url}/${agent_name}/.profile.git" local clone_url="${forge_url}/${agent_name}/.profile.git"
local auth_url local auth_url
auth_url=$(printf '%s' "$forge_url" | sed "s|://|://${agent_name}:${user_token:-${FORGE_TOKEN}}@|") auth_url=$(printf '%s' "$forge_url" | sed "s|://|://${agent_name}:${user_token:-${FORGE_TOKEN}}@|")
clone_url="${auth_url}/.profile.git" clone_url="${auth_url}/.profile.git"
echo " Cloning: ${clone_url}" # Display unauthenticated URL (auth token only in actual git clone command)
echo " Cloning: ${forge_url}/${agent_name}/.profile.git"
if ! git clone --quiet "$clone_url" "$clone_dir" 2>/dev/null; then if ! git clone --quiet "$clone_url" "$clone_dir" 2>/dev/null; then
# Try without auth (might work for public repos or with FORGE_TOKEN) # Try without auth (might work for public repos or with FORGE_TOKEN)