PEP-267: чтение из Gitea повторяется один раз при обрыве соединения — гейт не закрывается на сетевом сбое
All checks were successful
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 97с
peppa/build build: success за 46с
peppa/test test: success за 1395с
peppa-ci / ci (pull_request) Successful in 26m15s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
peppa-bot 2026-11-24 19:18:59 +00:00
parent af7b64df89
commit e6393bf641
2 changed files with 14 additions and 6 deletions

View File

@ -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 <cli> <версия>` (меняет 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}`).

View File

@ -110,11 +110,19 @@ export class GiteaClient {
}
async request<T>(method: string, path: string, body?: unknown): Promise<T> {
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();