api: autoPause default is declared in the spec and in a Go constant with no test keeping them in sync
维护者通常 2 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 84/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go, openapi
调研方向
从 packages/api/internal/api/spec_test.go 和 issue 中提到的现有契约测试开始。阅读 spec/openapi.yml 中的 NewSandbox 和 NewSandboxV2 schemas,然后定位 sandboxtypes.AutoPauseDefault 及其在 sandbox_create.go 中的用法。当任一 spec 默认值与 Go 常量不同时测试失败,而二者匹配时测试通过,即为完成。
由索引模型根据 Issue 内容生成。
描述
Summary
The default timeout action for a sandbox (autoPause when omitted) is declared in two places in this repo with no test keeping them in sync:
- OpenAPI spec —
spec/openapi.yml,NewSandboxandNewSandboxV2both declareautoPause: { type: boolean, default: false }. This is documentation only: the generated Go type is*boolwithomitempty(api.gen.go), so the spec default is never applied at decode time. - Go constant —
sandboxtypes.AutoPauseDefault = false, which is whatsandbox_create.goactually applies viaDerefOrDefault(body.AutoPause, sandbox.AutoPauseDefault)when the request omitsautoPause.
The spec value is the one the SDKs read and document as the default (see e2b-dev/E2B #2057 — both SDKs hardcode "currently kill" against this). If the Go constant ever changes without the spec (or vice versa), the published contract silently lies about what an omitted autoPause does, and the SDKs' documented/validated default drifts from reality — with no signal.
Proposal
Add a contract test (mirroring the existing TestSpecSecuritySchemeHeaderNames / TestTemplateBuildMinimumFreeDiskContract pattern in packages/api/internal/api/spec_test.go) that asserts the spec's declared autoPause default on NewSandbox and NewSandboxV2 equals sandboxtypes.AutoPauseDefault. Makes the spec the single documented source of the default and fails CI on drift.
This is the infra-side half of the drift concern raised in e2b-dev/E2B #2057 (the SDK-side half — single-sourcing the SDK's local assumption — is handled there).
- 主要语言
- Go
- 星标
- 1.8k
- 派生
- 503
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
e2b-dev/runtime 的其他 Issue
-
orchestrator: NFS-cache "cache path is not set" WARN logged on every build/launch instead of once可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
client-proxy: WARN "invalid host" spam from unroutable bare-IP Host requests (external probes)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 2 天内回复
-
[Bug]: flock() on a mounted volume hangs forever (mount is missing `nolock`)可能已有人在做 @AdaAibaby 于 57 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 2 天内回复
-
sandbox cache: StartRemoving state transition not broadcast, all allocations see stale Running state可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
cmd/ebitenmobile: multi-language bindings run the complete generator twice可能已有人在做 @kumagi 今天认领。 未关闭os:macos performance
难度 2/5 1-3 小时 新手友好度 82/100
hajimehoshi/ebiten#4011 · 1 条评论 ·
维护者通常 1 天内回复
-
agent-butler-finding chore
难度 1/5 1 小时以内 新手友好度 78/100
jordansmall/spindrift#6318 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
Eyevinn/moqlivemock#166 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
JakeChampion/lang#14091 ·
维护者通常 1 天内回复