diff --git a/.peppa/memory.md b/.peppa/memory.md index 4f920885..697832e0 100644 --- a/.peppa/memory.md +++ b/.peppa/memory.md @@ -31,7 +31,7 @@ - Агент в контейнере не видит хост сервера, Mac и Cloudflare (PEP-231): инфраструктуру — скриптом в `scripts/server-move/` + шаги в docs/SERVER.md, выполнить просить суперадмина через `report_blocker`. - Пути сессий с Mac (PEP-246): `runnerCwd` пересоздаёт копию сам; чистка — `peppa session paths --fix`. - Сервер (PEP-230): docs/SERVER.md. Нет глобального git в контейнере: автор — `gitRelayEnv`; иначе `git -c user.name=peppa-bot -c user.email=peppa-bot@telecom.quest commit`. -- Песочница раннера: нет tmux, openspec, Node 26 (есть 22). tmux — .deb deb.debian.org (tmux_3.3a-3, libevent-core-2.1-7, libutempter0) → `dpkg-deb -x` + LD_LIBRARY_PATH; openspec — `npm i -g --prefix /tmp/os @fission-ai/openspec`. Падают и на main (среда): glossary-check, sandbox-hosts, codex-recovery, subscriptions, platform-delays (часть). +- Песочница раннера: нет tmux, openspec, Node 26 (есть 22; без 26 mock-claude молча выходит — тесты с агентом падают по таймауту; tar.gz с nodejs.org/dist в /tmp + PATH). tmux — .deb deb.debian.org (tmux_3.3a-3, libevent-core-2.1-7, libutempter0) → `dpkg-deb -x` + LD_LIBRARY_PATH; openspec — `npm i -g --prefix /tmp/os @fission-ai/openspec`. Падают и на main (среда): glossary-check, sandbox-hosts, codex-recovery, subscriptions, platform-delays (часть). - Версии CLI агентов (PEP-267) — только `scripts/runner-image.sh --try <версия>` (меняет json и оба Dockerfile), откат — `--rollback`. - Codex (PEP-241): доверие папке — по корню основного репо worktree; `-c` режет ключ по точкам — пишем в config.toml CODEX_HOME (`codex-trust.ts`). - tmux на сервере (PEP-256) — контейнер `peppa-tmux`, сервисы — клиенты (`PEPPA_TMUX_EXTERNAL`); его образ меняет только `platform-deploy.sh --tmux`. Нет docker — compose проверяй парсером `yaml` (`{merge:true}`). diff --git a/packages/core/src/gitea.ts b/packages/core/src/gitea.ts index cad4862b..4036be0f 100644 --- a/packages/core/src/gitea.ts +++ b/packages/core/src/gitea.ts @@ -110,11 +110,19 @@ export class GiteaClient { } async request(method: string, path: string, body?: unknown): Promise { - const res = await fetch(`${this.baseUrl}/api/v1${path}`, { - method, - headers: { Authorization: `token ${this.token}`, "Content-Type": "application/json", Accept: "application/json" }, - body: body === undefined ? undefined : JSON.stringify(body), - signal: AbortSignal.timeout(15_000), + const send = () => + fetch(`${this.baseUrl}/api/v1${path}`, { + method, + headers: { Authorization: `token ${this.token}`, "Content-Type": "application/json", Accept: "application/json" }, + body: body === undefined ? undefined : JSON.stringify(body), + signal: AbortSignal.timeout(15_000), + }); + // A reading request that failed on the connection itself (a reused keep-alive socket the + // server has just closed, a reset) is safe to send once more; a gate must not close on it. + const res = await send().catch(async (e: unknown) => { + if (method !== "GET" || !(e instanceof TypeError)) throw e; + await new Promise((r) => setTimeout(r, 200)); + return send(); }); if (res.status === 204) return undefined as T; const text = await res.text();