[FEATURE] Make the actor wakeup probe timeout configurable

Đang mở
#3,753 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@CoffeeAnon đang làm issue này rồi.

Từ ngày 20/11/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, helm, kubernetes
Lĩnh vực
api, backend

Hướng nghiên cứu

Start with the RuntimeSubstratePolicy type that Harness and SandboxTemplate embed, then follow the hardcoded TimeoutSeconds: 30 in go/core/internal/substrate/actor_template.go and in sandbox.go. Trace how the kagent, byo, codex and claude compilers fill Revision, since the new *int32 field must be copied there and folded into the revision digest so unset revisions keep their existing digest. Done means the field validates 1-600, defaults to 30 when unset, and an unchanged manifest produces no new ActorTemplate. Note the author says a pull request already exists, so coordinate before starting.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

📋 Prerequisites
📝 Feature Summary

Add an optional spec.substrate.wakeupProbeTimeoutSeconds to Harness and SandboxTemplate, in place of the 30 second wakeup probe timeout that is hardcoded today.

❓ Problem Statement / Motivation

go/core/internal/substrate/actor_template.go compiles every runtime into an ActorTemplate whose wakeup probe has TimeoutSeconds: 30. sandbox.go hardcodes the same value for sandboxes. Substrate accepts any value, but no API field, Helm value or environment variable exposes it.

A runtime that is not ready within 30s of container start fails its golden build with:

GoldenActorCrashed: ... wakeup probe for "kagent" never returned 200 within 30s

The controller then retries with backoff, and the message reports a crash even when the runtime was only slow to start.

Anyone running the stack locally on a development machine can hit this. Under gVisor, import time dominates startup, and time to ready scales with the size of the runtime's dependency tree and the speed of the machine. On a local stack:

  • kagent's own Go runtime is ready in under a second on golden builds and on resumes.
  • A Python bring-your-own (BYO) runtime built on kagent-core and kagent-adk took 20 to 29s to become ready, which sits at the 30s limit. Some golden builds passed and some failed. Resumes of the same image took 20 to 28s, so the margin is thin on every resume too.
  • Precompiling bytecode helped but did not remove the problem.

Tuning the runtime resolved that case, but any BYO runtime with a larger dependency tree or any slower machine meets the same fixed limit with no setting to change.

💡 Proposed Solution

Add an optional typed field to RuntimeSubstratePolicy, which Harness and SandboxTemplate both embed:

spec:
  substrate:
    wakeupProbeTimeoutSeconds: 90
  • Type *int32, minimum 1, maximum 600. Unset means 30, so default behavior is unchanged.
  • The kagent, byo, codex and claude compilers copy the value into Revision.
  • The value is part of the revision digest, because a changed timeout changes the ActorTemplate and ActorTemplates are immutable. The digest field is omitempty, so a revision that leaves it unset keeps its existing digest and no ActorTemplate is recreated on upgrade.
  • The field is typed instead of an environment variable, as the review of #2358 asked for the bash tool timeout (#2357).

The implementation is ready as a pull request.

🔄 Alternatives Considered
  • An environment variable on the controller or the runtime. Review of #2358 asked for typed configuration instead.
  • A larger fixed default. This delays failure detection for every runtime to help the slowest one.
  • Only tuning the runtime. This works for one image but leaves every other BYO runtime and slower machine with no setting.
🎯 Affected Service(s)

None

📚 Additional Context

Related changes that are not part of the proposed PR:

  • The Python kagent-core _bootstrap.load_bundle gives the GetBootstrapConfig fetch its own 20s deadline, commented as headroom inside the 30s probe. If the probe timeout is raised, that deadline should follow it.
  • GoldenActorCrashed could say when the probe timed out with the process still running.
  • The Python BYO docs could recommend shipping precompiled bytecode.
🙋 Are you willing to contribute?
  • I am willing to submit a PR for this feature
Ngôn ngữ chính
Go
Star
4.5k
Fork
937
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
150

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của kagent-dev/kagent

Tất cả issue của kagent-dev/kagent

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.