Skip to content

Commit c0fa1cd

Browse files
konardclaude
andcommitted
fix(shell): resolve merge conflict — keep healthcheck + add upstream DNS settings
Merges upstream/main into issue-137, combining our healthcheck feature with upstream's DNS settings (8.8.8.8, 8.8.4.4, 1.1.1.1) on the browser service. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 parents e97a214 + e9b33cf commit c0fa1cd

65 files changed

Lines changed: 4685 additions & 714 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ done < <(
1515
-print0
1616
)
1717

18+
# CHANGE: auto-stage AI agent config directories (.gemini, .claude, .codex)
19+
# WHY: ensures AI session context is always included in commits without manual git add
20+
# REF: issue-170
21+
for ai_dir in .gemini .claude .codex; do
22+
if [ -d "$ai_dir" ]; then
23+
git add -A -- "$ai_dir"
24+
fi
25+
done
26+
1827
MAX_BYTES=$((99 * 1000 * 1000))
1928
too_large=()
2029

.githooks/pre-push

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,14 @@ if [ "${DOCKER_GIT_SKIP_KNOWLEDGE_GUARD:-}" = "1" ]; then
1010
fi
1111

1212
node scripts/pre-push-knowledge-guard.js "$@"
13+
14+
# CHANGE: backup AI session to a private session repository on push (supports Claude, Codex, Gemini)
15+
# WHY: allows returning to old AI sessions and provides PR context without gist limits
16+
# QUOTE(ТЗ): "когда происходит push мы сразу заливаем текущую сессию с AI агентом в gits приватный"
17+
# REF: issue-143
18+
# PURITY: SHELL
19+
if [ "${DOCKER_GIT_SKIP_SESSION_BACKUP:-}" != "1" ]; then
20+
if command -v gh >/dev/null 2>&1; then
21+
node scripts/session-backup-gist.js --verbose || echo "[session-backup] Warning: session backup failed (non-fatal)"
22+
fi
23+
fi

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ runs:
1010
using: composite
1111
steps:
1212
- name: Install pnpm
13-
uses: pnpm/action-setup@v3
13+
uses: pnpm/action-setup@v5
1414
- name: Install node
1515
uses: actions/setup-node@v6
1616
with:
1717
cache: pnpm
1818
node-version: ${{ inputs.node-version }}
1919
- name: Install dependencies
2020
shell: bash
21-
run: pnpm install
21+
run: pnpm install --frozen-lockfile

.github/workflows/check.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
- uses: actions/checkout@v6
2424
- name: Install dependencies
2525
uses: ./.github/actions/setup
26+
- name: Build (docker-git package)
27+
run: pnpm --filter ./packages/app build
2628

2729
types:
2830
name: Types

.github/workflows/checking-dependencies.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v6
15-
- uses: pnpm/action-setup@v4
15+
- uses: pnpm/action-setup@v5
1616
- uses: actions/setup-node@v6
1717
with:
1818
node-version: 24.14.0

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@ yarn-error.log*
2323
pnpm-debug.log*
2424
reports/
2525
.idea
26-
.claude

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ services:
99
CODEX_HOME: "/home/dev/.codex"
1010
ports:
1111
- "127.0.0.1:2222:22"
12+
dns:
13+
- 8.8.8.8
14+
- 8.8.4.4
15+
- 1.1.1.1
1216
volumes:
1317
- dev_home:/home/dev
1418
- ./authorized_keys:/authorized_keys:ro

entrypoint.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,42 @@
1111
# COMPLEXITY: O(network + repo_size)
1212
set -euo pipefail
1313

14+
# 0) Ensure DNS resolution works; repair /etc/resolv.conf if Docker DNS is broken
15+
docker_git_repair_dns() {
16+
local test_domain="github.com"
17+
local resolv="/etc/resolv.conf"
18+
local fallback_dns="8.8.8.8 8.8.4.4 1.1.1.1"
19+
20+
if getent hosts "$test_domain" >/dev/null 2>&1; then
21+
return 0
22+
fi
23+
24+
echo "[dns-repair] DNS resolution failed for $test_domain; attempting repair..."
25+
26+
local has_external=0
27+
for ns in $fallback_dns; do
28+
if grep -q "nameserver $ns" "$resolv" 2>/dev/null; then
29+
has_external=1
30+
fi
31+
done
32+
33+
if [[ "$has_external" -eq 0 ]]; then
34+
for ns in $fallback_dns; do
35+
printf "nameserver %s\n" "$ns" >> "$resolv"
36+
done
37+
echo "[dns-repair] appended fallback nameservers to $resolv"
38+
fi
39+
40+
if getent hosts "$test_domain" >/dev/null 2>&1; then
41+
echo "[dns-repair] DNS resolution restored"
42+
return 0
43+
fi
44+
45+
echo "[dns-repair] WARNING: DNS resolution still failing after repair attempt"
46+
return 1
47+
}
48+
docker_git_repair_dns || true
49+
1450
REPO_URL="${REPO_URL:-}"
1551
REPO_REF="${REPO_REF:-}"
1652
TARGET_DIR="${TARGET_DIR:-/work/app}"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Test that the pre-commit hook logic correctly stages AI config directories
5+
echo "=== Testing AI directory auto-staging logic ==="
6+
7+
REPO_ROOT="$(git rev-parse --show-toplevel)"
8+
cd "$REPO_ROOT"
9+
10+
# Create test AI directories with test files
11+
for ai_dir in .gemini .claude .codex; do
12+
mkdir -p "$ai_dir"
13+
echo "test-content-$(date +%s)" > "$ai_dir/test-file.txt"
14+
done
15+
16+
echo "Created test files:"
17+
ls -la .gemini/test-file.txt .claude/test-file.txt .codex/test-file.txt
18+
19+
# Check gitignore status
20+
echo ""
21+
echo "=== Checking gitignore status ==="
22+
for ai_dir in .gemini .claude .codex; do
23+
if git check-ignore -q "$ai_dir/test-file.txt" 2>/dev/null; then
24+
echo "IGNORED: $ai_dir (this is a problem!)"
25+
else
26+
echo "NOT IGNORED: $ai_dir (good - can be tracked)"
27+
fi
28+
done
29+
30+
# Simulate the auto-staging logic from the pre-commit hook
31+
echo ""
32+
echo "=== Simulating auto-staging ==="
33+
for ai_dir in .gemini .claude .codex; do
34+
if [ -d "$ai_dir" ]; then
35+
git add -A -- "$ai_dir"
36+
echo "Staged: $ai_dir"
37+
fi
38+
done
39+
40+
echo ""
41+
echo "=== Staged files ==="
42+
git diff --cached --name-only | grep -E "^\.(gemini|claude|codex)/" || echo "(none found)"
43+
44+
# Clean up - unstage the test files
45+
git reset HEAD -- .gemini .claude .codex 2>/dev/null || true
46+
rm -rf .gemini/test-file.txt .claude/test-file.txt .codex/test-file.txt
47+
48+
echo ""
49+
echo "=== Test complete ==="

packages/api/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
},
2020
"dependencies": {
2121
"@effect-template/lib": "workspace:*",
22-
"@effect/platform": "^0.94.5",
23-
"@effect/platform-node": "^0.104.1",
22+
"@effect/platform": "^0.96.0",
23+
"@effect/platform-node": "^0.106.0",
2424
"@effect/schema": "^0.75.5",
25-
"effect": "^3.19.19"
25+
"effect": "^3.21.0"
2626
},
2727
"devDependencies": {
28-
"@effect/vitest": "^0.27.0",
28+
"@effect/vitest": "^0.29.0",
2929
"@eslint/js": "10.0.1",
3030
"@types/node": "^24.12.0",
31-
"@typescript-eslint/eslint-plugin": "^8.57.0",
32-
"@typescript-eslint/parser": "^8.57.0",
33-
"eslint": "^10.0.3",
31+
"@typescript-eslint/eslint-plugin": "^8.57.1",
32+
"@typescript-eslint/parser": "^8.57.1",
33+
"eslint": "^10.1.0",
3434
"globals": "^17.4.0",
3535
"typescript": "^5.9.3",
3636
"vitest": "^4.1.0"

0 commit comments

Comments
 (0)