mirror of
https://github.com/kvcache-ai/AgentENV.git
synced 2026-11-05 01:17:36 +00:00
[PR #246] [MERGED] template: report failed build steps by number, not instruction text #287
Labels
No labels
bug
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/AgentENV#287
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/AgentENV/pull/246
Author: @nblintao
Created: 9/4/2026
Status: ✅ Merged
Merged: 9/7/2026
Merged by: @LSX-s-Software
Base:
main← Head:fix/build-step-index📝 Commits (2)
41b31cdtemplate: report failed build steps by number, not instruction text5e3b497template: number failed steps by their client-visible position📊 Changes
3 files changed (+144 additions, -11 deletions)
View changed files
📝
src/api/impls/template_helpers.rs(+39 -2)📝
src/template/build_spec.rs(+26 -0)📝
src/template/step_executor.rs(+79 -9)📄 Description
What happens today
When a template build step fails, AgentENV fills
BuildStatusReason.stepwith the instruction text ("RUN apt-get update && …",src/template/step_executor.rs). The official e2b Python SDK resolves that field as an index into its locally recorded stack traces —get_build_step_indexmaps"base"→ 0,"finalize"→ last, and otherwise callsint(step)with no fallback (packages/python-sdk/e2b/template/utils.py). So any failed build crashes the SDK's error path:…and the real build error (already carried in
message) is never raised. The JS SDK doesn't crash but silently loses the traceback (Number(step)→NaN).The contract
The OpenAPI spec leaves
stepan unconstrained string ("Step that failed"), but e2b Cloud fills it with the 1-based step number (e2b-dev/infra,packages/orchestrator/pkg/template/build/phases/utils.go:strconv.Itoa(*StepNumber), numbered from 1 inphases/steps/factory.go), with"base"/"finalize"for those phases — and both official SDKs hard-code exactly that mapping. De-facto, numeric-or-sentinel is the contract.Change
reason.stepnow carries the 1-based step number as a string.message, next to the exit status and stderr it already reports:step: None, which both SDKs skip safely.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.