Skip to content

Commit 355fa60

Browse files
authored
Merge pull request #263 from AgentWorkforce/fix/git-auth-permanent-solution
fix: Add GH token fallback for git authentication
2 parents 4656fab + e7d89dd commit 355fa60

File tree

10 files changed

+528
-4
lines changed

10 files changed

+528
-4
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"id": "traj_4lcghlrot4vs",
3+
"version": 1,
4+
"task": {
5+
"title": "Investigate git-credential-relay blocker"
6+
},
7+
"status": "completed",
8+
"startedAt": "2026-01-22T08:01:01.162Z",
9+
"agents": [
10+
{
11+
"name": "default",
12+
"role": "lead",
13+
"joinedAt": "2026-01-22T08:08:28.198Z"
14+
}
15+
],
16+
"chapters": [
17+
{
18+
"id": "chap_lobu3ax505iu",
19+
"title": "Work",
20+
"agentName": "default",
21+
"startedAt": "2026-01-22T08:08:28.198Z",
22+
"events": [
23+
{
24+
"ts": 1769069308199,
25+
"type": "decision",
26+
"content": "Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents: Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents",
27+
"raw": {
28+
"question": "Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents",
29+
"chosen": "Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents",
30+
"alternatives": [],
31+
"reasoning": "Helper currently hard-fails when CLOUD_API_URL unavailable; GH_TOKEN injection avoids cloud dependency"
32+
},
33+
"significance": "high"
34+
}
35+
],
36+
"endedAt": "2026-01-22T08:08:59.319Z"
37+
}
38+
],
39+
"commits": [],
40+
"filesChanged": [],
41+
"projectId": "/data/repos/relay",
42+
"tags": [],
43+
"completedAt": "2026-01-22T08:08:59.319Z",
44+
"retrospective": {
45+
"summary": "Investigated git-credential-relay wiring and cloud dependency; reported locations and suggested GH_TOKEN fallback",
46+
"approach": "Standard approach",
47+
"confidence": 0.72
48+
}
49+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Trajectory: Investigate git-credential-relay blocker
2+
3+
> **Status:** ✅ Completed
4+
> **Confidence:** 72%
5+
> **Started:** January 22, 2026 at 08:01 AM
6+
> **Completed:** January 22, 2026 at 08:08 AM
7+
8+
---
9+
10+
## Summary
11+
12+
Investigated git-credential-relay wiring and cloud dependency; reported locations and suggested GH_TOKEN fallback
13+
14+
**Approach:** Standard approach
15+
16+
---
17+
18+
## Key Decisions
19+
20+
### Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents
21+
- **Chose:** Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents
22+
- **Reasoning:** Helper currently hard-fails when CLOUD_API_URL unavailable; GH_TOKEN injection avoids cloud dependency
23+
24+
---
25+
26+
## Chapters
27+
28+
### 1. Work
29+
*Agent: default*
30+
31+
- Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents: Documented git-credential-relay dependency on CLOUD_API_URL and suggested GH_TOKEN fallback for agents
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"id": "traj_dwvjn9kpo59t",
3+
"version": 1,
4+
"task": {
5+
"title": "Fix git-credential-relay CLOUD_API_URL dependency"
6+
},
7+
"status": "completed",
8+
"startedAt": "2026-01-22T08:19:18.842Z",
9+
"agents": [
10+
{
11+
"name": "default",
12+
"role": "lead",
13+
"joinedAt": "2026-01-22T08:19:26.683Z"
14+
}
15+
],
16+
"chapters": [
17+
{
18+
"id": "chap_98uuyosmelbr",
19+
"title": "Work",
20+
"agentName": "default",
21+
"startedAt": "2026-01-22T08:19:26.683Z",
22+
"events": [
23+
{
24+
"ts": 1769069966684,
25+
"type": "decision",
26+
"content": "Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution: Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution",
27+
"raw": {
28+
"question": "Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution",
29+
"chosen": "Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution",
30+
"alternatives": [],
31+
"reasoning": "Ensures git push works without CLOUD_API_URL by preferring local token sources"
32+
},
33+
"significance": "high"
34+
}
35+
],
36+
"endedAt": "2026-01-22T08:19:33.967Z"
37+
}
38+
],
39+
"commits": [],
40+
"filesChanged": [],
41+
"projectId": "/data/repos/relay",
42+
"tags": [],
43+
"completedAt": "2026-01-22T08:19:33.967Z",
44+
"retrospective": {
45+
"summary": "Added GH_TOKEN/GITHUB_TOKEN fallback for git-credential-relay and spawner GH token resolution",
46+
"approach": "Standard approach",
47+
"confidence": 0.8
48+
}
49+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Trajectory: Fix git-credential-relay CLOUD_API_URL dependency
2+
3+
> **Status:** ✅ Completed
4+
> **Confidence:** 80%
5+
> **Started:** January 22, 2026 at 08:19 AM
6+
> **Completed:** January 22, 2026 at 08:19 AM
7+
8+
---
9+
10+
## Summary
11+
12+
Added GH_TOKEN/GITHUB_TOKEN fallback for git-credential-relay and spawner GH token resolution
13+
14+
**Approach:** Standard approach
15+
16+
---
17+
18+
## Key Decisions
19+
20+
### Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution
21+
- **Chose:** Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution
22+
- **Reasoning:** Ensures git push works without CLOUD_API_URL by preferring local token sources
23+
24+
---
25+
26+
## Chapters
27+
28+
### 1. Work
29+
*Agent: default*
30+
31+
- Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution: Implemented GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner token resolution
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"id": "traj_s37dndilyyr0",
3+
"version": 1,
4+
"task": {
5+
"title": "Implement git credential relay GH_TOKEN fallback"
6+
},
7+
"status": "completed",
8+
"startedAt": "2026-01-22T08:15:29.721Z",
9+
"agents": [
10+
{
11+
"name": "default",
12+
"role": "lead",
13+
"joinedAt": "2026-01-22T08:16:17.415Z"
14+
}
15+
],
16+
"chapters": [
17+
{
18+
"id": "chap_3vspwas490cf",
19+
"title": "Work",
20+
"agentName": "default",
21+
"startedAt": "2026-01-22T08:16:17.415Z",
22+
"events": [
23+
{
24+
"ts": 1769069777416,
25+
"type": "decision",
26+
"content": "Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution: Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution",
27+
"raw": {
28+
"question": "Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution",
29+
"chosen": "Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution",
30+
"alternatives": [],
31+
"reasoning": "Removes CLOUD_API_URL dependency and provides local dev fallback when cloud API is unreachable"
32+
},
33+
"significance": "high"
34+
}
35+
],
36+
"endedAt": "2026-01-22T08:18:03.557Z"
37+
}
38+
],
39+
"commits": [],
40+
"filesChanged": [],
41+
"projectId": "/data/repos/relay",
42+
"tags": [],
43+
"completedAt": "2026-01-22T08:18:03.557Z",
44+
"retrospective": {
45+
"summary": "Added GH_TOKEN/GITHUB_TOKEN fallback to git-credential-relay and spawner token resolution from hosts.yml/gh CLI",
46+
"approach": "Standard approach",
47+
"confidence": 0.78
48+
}
49+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Trajectory: Implement git credential relay GH_TOKEN fallback
2+
3+
> **Status:** ✅ Completed
4+
> **Confidence:** 78%
5+
> **Started:** January 22, 2026 at 08:15 AM
6+
> **Completed:** January 22, 2026 at 08:18 AM
7+
8+
---
9+
10+
## Summary
11+
12+
Added GH_TOKEN/GITHUB_TOKEN fallback to git-credential-relay and spawner token resolution from hosts.yml/gh CLI
13+
14+
**Approach:** Standard approach
15+
16+
---
17+
18+
## Key Decisions
19+
20+
### Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution
21+
- **Chose:** Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution
22+
- **Reasoning:** Removes CLOUD_API_URL dependency and provides local dev fallback when cloud API is unreachable
23+
24+
---
25+
26+
## Chapters
27+
28+
### 1. Work
29+
*Agent: default*
30+
31+
- Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution: Added GH_TOKEN/GITHUB_TOKEN fallback in git-credential-relay and spawner-side hosts.yml/gh auth token resolution

.trajectories/index.json

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"version": 1,
3-
"lastUpdated": "2026-01-21T22:30:12.356Z",
3+
"lastUpdated": "2026-01-22T08:19:34.279Z",
44
"trajectories": {
55
"traj_ozd98si6a7ns": {
66
"title": "Fix thinking indicator showing on all messages",
@@ -883,6 +883,27 @@
883883
"startedAt": "2026-01-21T22:10:45.793Z",
884884
"completedAt": "2026-01-21T22:30:11.795Z",
885885
"path": "/data/repos/relay/.trajectories/completed/2026-01/traj_jl5pp8rdu8up.json"
886+
},
887+
"traj_4lcghlrot4vs": {
888+
"title": "Investigate git-credential-relay blocker",
889+
"status": "completed",
890+
"startedAt": "2026-01-22T08:01:01.162Z",
891+
"completedAt": "2026-01-22T08:08:59.319Z",
892+
"path": "/data/repos/relay/.trajectories/completed/2026-01/traj_4lcghlrot4vs.json"
893+
},
894+
"traj_s37dndilyyr0": {
895+
"title": "Implement git credential relay GH_TOKEN fallback",
896+
"status": "completed",
897+
"startedAt": "2026-01-22T08:15:29.721Z",
898+
"completedAt": "2026-01-22T08:18:03.557Z",
899+
"path": "/data/repos/relay/.trajectories/completed/2026-01/traj_s37dndilyyr0.json"
900+
},
901+
"traj_dwvjn9kpo59t": {
902+
"title": "Fix git-credential-relay CLOUD_API_URL dependency",
903+
"status": "completed",
904+
"startedAt": "2026-01-22T08:19:18.842Z",
905+
"completedAt": "2026-01-22T08:19:33.967Z",
906+
"path": "/data/repos/relay/.trajectories/completed/2026-01/traj_dwvjn9kpo59t.json"
886907
}
887908
}
888909
}

deploy/workspace/git-credential-relay

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ if [[ "$host" != "github.com" ]]; then
4545
exit 0
4646
fi
4747

48+
# If a token is already provided via env, use it directly (no cloud dependency)
49+
if [[ -n "${GH_TOKEN:-}" || -n "${GITHUB_TOKEN:-}" ]]; then
50+
token="${GH_TOKEN:-${GITHUB_TOKEN}}"
51+
debug "Using GH_TOKEN/GITHUB_TOKEN from environment"
52+
echo "protocol=https"
53+
echo "host=github.com"
54+
echo "username=x-access-token"
55+
echo "password=${token}"
56+
exit 0
57+
fi
58+
4859
# Check required environment variables
4960
if [[ -z "${WORKSPACE_ID:-}" ]]; then
5061
echo "git-credential-relay: WORKSPACE_ID not set" >&2

0 commit comments

Comments
 (0)