Daemon: refuse leased requests that name no session at request admission

未关闭
#4,171 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@airowe 已经在做这个了。

开始于 2026年11月2日。

  • #4177 来自 @airowe —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
25/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
backend

调研方向

Start in packages/daemon/src/server/http/http-rpc-methods.ts around line 48, where a missing session is defaulted, and in packages/daemon/src/sessions/request-admission.ts around line 48, where the tenant-scoped default is built. Record whether the caller supplied a session before the default is applied. Done means an unnamed lease.allocate, and an unnamed leased command, are refused with REMOTE_SESSION_REQUIRED before allocation or dispatch, while named requests and daemons without a lease provider behave as before. Check the existing real-daemon tests for the session and lease paths, since the issue asks for the new tests to run against a real daemon. Linked PR #4177 is already open, so coordinate with it before starting.

由索引模型根据 Issue 内容生成。

描述

bug ready-for-agent

Follow-up from #3931 and #4159.

#4159 makes the CLI refuse every command on a leased remote connection unless it names a session (--session, AGENT_DEVICE_SESSION or config). The rule is enforced in the CLI, though. A review of #4159 found that direct daemon RPC callers are not covered: a request with no session becomes default, then <tenant>:default (packages/daemon/src/server/http/http-rpc-methods.ts:48, packages/daemon/src/sessions/request-admission.ts:48). Against an isolated real daemon, an unnamed authenticated agent_device.lease.allocate allocated a proxy lease, and unnamed leased commands reached normal dispatch.

Required behavior

  • Daemon request admission records whether the caller supplied a session before it defaults one.
  • A request that would allocate, use or release a lease from a lease provider, with no caller-supplied session, is refused with the same typed reason (REMOTE_SESSION_REQUIRED) before allocation or dispatch.
  • Requests with no lease provider are unchanged.
  • Tests run against a real daemon: an unnamed lease.allocate is refused, an unnamed leased command is refused, and named requests are unaffected.
主要语言
TypeScript
星标
5.2k
派生
359
平均合并
13 小时 23 分钟
30 天内合并 PR
655

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

callstack/agent-device 的其他 Issue

查看 callstack/agent-device 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。