Own turn lifecycle in durable-queue tests
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 重构
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- redis, sql, typescript
调研方向
从 packages/junior/tests/integration/durable-queue.test.ts 开始,并阅读 packages/junior/src/chat/task-execution/README.md 以及 policies/testing.md。运行现有的 durable-queue 集成测试,然后覆盖所列出的 live Slack-to-worker 结果,不要预先创建 checkpoint,也不要替换由 Junior 所有的运行时组件;完成的标准是对终态、SQL 历史、回复和后续 mention 都进行断言。
由索引模型根据 Issue 内容生成。
描述
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
agentRunneronly 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
- https://github.com/getsentry/junior/pull/1397 — accepted tool-free reply completes the turn
- https://github.com/getsentry/junior/pull/1381 — timeout slice gets a fresh host request
- https://github.com/getsentry/junior/issues/1114 — resume fallback after an earlier reply (related policy, separate issue)
- Sentry JUNIOR-7Y: https://sentry.sentry.io/issues/7664050472/
- Contract docs:
packages/junior/src/chat/task-execution/README.md,policies/testing.md
Requested by David Cramer.
--
- 主要语言
- TypeScript
- 星标
- 397
- 派生
- 43
- 平均合并
- 7 小时 55 分钟
- 30 天内合并 PR
- 661
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
getsentry/junior 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 84/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
getsentry/junior#335 · 1 个 reaction ·
维护者通常 1 天内回复
相似的 Issue
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P2
难度 2/5 1-3 小时 新手友好度 68/100
openclaw/openclaw#195577 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
EKKOLearnAI/ekko-studio#3729 ·
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 78/100
Supportseal/SupportSeal-app#98 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
eliasstravik/herdr-projects#845 ·
-
难度 1/5 1 小时以内 新手友好度 88/100
cloudflare/skills#279 ·
维护者通常 1 天内回复