Own turn lifecycle in durable-queue tests

Abierto
#1,398 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
redis, sql, typescript

Línea de trabajo

Empieza por packages/junior/tests/integration/durable-queue.test.ts y lee también packages/junior/src/chat/task-execution/README.md y policies/testing.md. Ejecuta las pruebas de integración existentes de durable-queue y, después, cubre los resultados de Slack-to-worker en vivo indicados, sin sembrar checkpoints ni sustituir componentes de ejecución gestionados por Junior; se considera terminado cuando se comprueban el estado terminal, el historial SQL, las respuestas y las menciones posteriores.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Turn lifecycle coverage is split across durable-queue, agent-continue-slack, heartbeat, and large component suites. Several “integration” cases seed Redis/SQL or replace the agent runner, so they miss path bugs (accept-then-timeout, multi-slice continue).

packages/junior/tests/integration/durable-queue.test.ts should own the product outcomes below. Drive live Slack ingress → worker → real agent. Fake only the model stream and Slack HTTP. Assert user-visible replies, turn terminal state, SQL history, and that a later mention still works.

Product outcomes

Outcome User-visible result Live drive
Happy path One mention → one reply → turn completed → mailbox empty Mention → run
Long turn survives host limit Deadline mid-work parks at a safe boundary; fresh wake finishes with one final reply; history kept Model does tool work, spend deadline, next queue wake finishes
Accepted reply is terminal After Slack accepts a tool-free reply, turn completes once; no second post; assistant stays in SQL Hold chat.postMessage past deadline (and/or lose lease after accept)
Worker dies mid-run (no accept) Turn fails once; committed history kept; next mention works Start run, expire lease before accept
Transient agent failure Fail before input commit → retry, no Slack post; retry limit → at most one fallback Throw before commit / until limit
Mid-turn steer Second @ mention folds into the same turn; still one final reply Hold active run, second mention, release

Every terminal case must leave the conversation able to take a new user mention.

Harness rules

  • Start from webhook ingress or a real queue wake after a live park. Do not seed turn checkpoints for these product contracts once the live path can create the state.
  • Do not replace Junior-owned runtime, resume, checkpoint, worker, lease, mailbox, or queue routing.
  • Custom agentRunner only for edges the model stream cannot express (e.g. throw before input commit). Prefer stream + real durability otherwise.
  • Disrupt from outside: hold Slack HTTP, spend the host deadline, expire the lease, send a second mention.

Out of scope here

  • Reply chunking / fallback copy → finalized-reply-behavior
  • Cross-actor steer policy → conversation-turn-steering-behavior
  • OAuth link UX / credential copy → oauth-resume-slack
  • Heartbeat only enqueueing a wake for stale paused rows → heartbeat
  • Cursor schema / append-only history rules → component tests

Current gaps (as of #1397)

  • Have live: happy path; accept during deadline (first slice); retry / retry-limit; steer (agent hold).
  • Missing live spine: long turn that times out mid-work, parks, resumes on a fresh wake, and finishes (production multi-slice shape).
  • Still seeded: lease loss after accept; worker disappear mid-run; timeout-pause “leave host request.”
  • Owned elsewhere / weak here: auth park+resume.

Related

Requested by David Cramer.

--

View Junior Session [Sentry]

Lenguaje dominante
TypeScript
Estrellas
397
Forks
43
Merge medio
7 h 42 min
PR fusionados (30 d)
650

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de getsentry/junior

Todos los issues de getsentry/junior

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.