Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

berth run --as NAME with no command should fall back to the engine entry's start

Đang mở Phù hợp với người mới
#232 0 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

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
76/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
Lĩnh vực
cli

Hướng nghiên cứu

Đọc internal/cli/run.go và theo dõi cách berth run --as NAME tải mục engine và xử lý khi thiếu lệnh. Dùng start của mục đó nếu có, giữ nguyên hành vi ghi đè bằng flag hiện có; giữ lỗi khi thiếu mục hoặc thiếu start của mục. Hoàn tất khi các bài kiểm thử bao quát cả hành vi dự phòng và trường hợp thiếu start, đồng thời CLI chạy lệnh đã cấu hình.

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

Mô tả

Current behavior

berth run requires the command after -- and refuses to run without it (--as NAME and the engine's command are required, internal/cli/run.go). The berth.toml entry for --as NAME supplies every setting — priority, needs_mib, the drain_* fields, container, compose, min_turn — but the command itself is never taken from the entry, even when the entry already carries one in start.

So a fully configured engine still needs the command re-typed on every run:

F:\AI\berth\berth.exe run --as pet-tagger --priority foreground -- docker compose -f "F:\AI\immich-pet-tagger\docker-compose.yml" up

with the compose path written twice (once for compose, once in the command).

Why it works

The entry already holds a complete command in start, and the gateway already treats start as a first-class start vector: it starts engines from it on demand (a request for the engine's url finds it not answering) and for background engines. So the configuration is already complete; only the CLI path doesn't use it.

Config validation already keeps the eligible set well-defined: a start without serves is an error unless the engine is background or comfyui, so an entry with a usable start is unambiguous.

Suggestion

When berth run --as NAME gets no command, exec the entry's start as the command, with the same flag-wins-override semantics the entry already has for the other settings. Keep the current error when the entry is missing or has no start.

Environment

  • Windows 11, RTX 5070 Ti (16 GiB)
  • berth v0.4.0-rc.3 binary; code verified at main @ 0ebd1c5

Engine entry used for the runs above:

[[engine]]
name = "pet-tagger"
type = "custom"
kind = "other"
url = "http://127.0.0.1:8000" # placeholder
health = "/" # placeholder
start = ["docker", "compose", "-f", "F:\\AI\\immich-pet-tagger\\docker-compose.yml", "up"]
compose = "F:\\AI\\immich-pet-tagger\\docker-compose.yml"
background = true
idle_after = "60s"
needs_mib = 2560
priority = "batch"
min_turn = "100s"
Ngôn ngữ chính
Go
Star
226
Fork
20
Merge trung bình
43 phút
Pull request đã merge (30 ngày)
192

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 T-Crypt/berth

Tất cả issue của T-Crypt/berth

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.