Idle leases: agent-device commands count as use and get the idle message

Đang mở
#1,908 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/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ệ
typescript
Lĩnh vực
backend, testing

Hướng nghiên cứu

Read ADR 0094 §2–3 and the agent-device boundaries in src/agent-device/AGENTS.md, then inspect runCommand, agentDeviceRelayTarget, and the worker seam modeled by src/agent-device/edge-heartbeat.test.ts. Cover the listed B6 and B7 cases, including local and relayed commands and idle-ended leases. Done when pnpm test:changed and pnpm typecheck pass, and agent-device.mdx shows the idle message beside the existing one.

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

Mô tả

task:ready

Part of #1899.

Scope

An agent-device command on a lease counts as use on the worker, whether it comes from a local agent-device CLI or is relayed from a gateway, and holds the lease in use while it streams. A command on a lease that ended idle gets lease ended by simlock: its device was not used for the worker's idle limit; run disconnect, then open instead of reaching agent-device.

If it goes wrong, an agent working through agent-device loses its lease as idle, or an agent sees the wrong message after an idle end.

Technical spec

Commit 056e29880.

Rows

Behaviours: B6, B7
Stored state: S2
Interfaces: I5 (uses I2, I3)
Existing code: X9, X10, X11, X18 (agent-device.mdx:212)

Facts
# Fact Source
F1 The same front is built on a gateway, where no worker module context exists src/agent-device/gateway.ts:127-149, src/agent-device/front/edge-parts.ts:15-26
F2 The front tells commands from heartbeats, releases and allocates by the RPC's kind src/agent-device/front/front.ts:51-54, :136-157
F3 A gateway routes a lease its index dropped for lease.maxTtlMs src/agent-device/front/relay-host-link.ts:67 (the gateway's lease.maxTtlMs bounds how long it routes a dropped lease)
Modules touched

agent-device (worker parts, front runCommand, relay target, replies), website agent-device page. Searches: rg "runCommand|agentDeviceRelayTarget|leaseEndedByHost|LEASE_ENDED_MESSAGE|beforeDeviceReclaim" src/agent-device.

Rules in play
  • ADR 0094 §2 and §3: agent-device commands are use; the gateway holds no idle clock.
  • src/agent-device/AGENTS.md Boundaries: front map and the idle-ended set live in memory only; the edge imports nothing from the gateway.
  • docs/internal/agent-rules/documentation.md rule 9: agent-device.mdx names the idle message.
Tests

Seam: the agent-device worker with a fake upstream (createWorkerWith), model on src/agent-device/edge-heartbeat.test.ts.

  • B6: an agent-device command restarts the clock and holds it while it runs: local command at 20 min; command streaming 10–45 min; relayed command; heartbeat; the gateway's front counts nothing.
  • B7: a command on an idle-ended lease answers I5: ended idle local and relayed; ended explicit / expired forwarded as today; idle id older than lease.maxTtlMs; the 1025th idle end forgets the oldest.

Done when

  • pnpm test:changed and pnpm typecheck pass.
  • agent-device.mdx shows the idle message beside today's one.

Out of scope

  • The idle clock, the idle reason and the use port itself (#1907).

Depends on

  • #1907
  • #1906 (it also changes routeCall and runCommand in src/agent-device/front/front.ts and agent-device.mdx; it is ready first)

Written by an agent.

Ngôn ngữ chính
TypeScript
Star
730
Fork
44
Merge trung bình
16 giờ 13 phút
Pull request đã merge (30 ngày)
387

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 callstackincubator/simlock

Tất cả issue của callstackincubator/simlock

Issue tương tự

Thêm issue về TypeScript

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.