Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

refactor(host): explicit host for configuration reads and one entered runtime store

已关闭
#3,794 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
领域
backend, devtools

调研方向

Start with the root platform-runtime-* files, platform packages, and defineRuntimeSlots modules; trace the remaining commandHostEnvironment() calls and runtime slot handles. Read the follow-ups #3763 and #3772 and the holistic review on #3747 for decisions already made. Done means configuration reads use the runtime's explicit host, one runtime-owned store is entered and disposed, and the daemon host test plus two-runtime isolation tests pass.

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

描述

in-progress ready-for-agent refactor

Part of #3747. Follow-up to #3763 and #3772, which leave two pieces deferred in their PR bodies.

1. Narrow commandHostEnvironment() to command execution

About 60 call sites remain in the root platform-runtime-* files and the platform packages. They read configuration (toolchain and SDK paths, caches, path resolution) through the ambient, AsyncLocalStorage-bound commandHostEnvironment(). The holistic review on the stack decided:

  • Configuration reads take the host explicitly. Pass it as a parameter, through the runtime deps, or through a port bound at construction.
  • The ambient lookup is only for host-kit command execution and diagnostics.

Done when:

  • Every non-test call of commandHostEnvironment() outside host-kit's command execution and diagnostics is replaced by an explicit host.
  • A test on the daemon route proves configuration is read from the runtime's host and not from the process, when the two differ.

2. One entered runtime store

#3772 moved per-runtime state onto defineRuntimeSlots. Each module still exposes its own handle, collected into runtimeStates.

Required:

  • Collapse them into one store, entered once per runtime.
  • Modules declare slots; the runtime owns entry and disposal.

Done when:

  • No module-level handle or runtimeStates aggregation remains.
  • The two-runtime isolation tests (Apple runner, Android helper, PNG worker, daemon modules) still pass.

Ordering

  • #3757 (agent-device/host) does not depend on this issue.
  • #3753 (lint gate) should land after part 1, so the gate can also forbid commandHostEnvironment() outside the command-execution boundary.
主要语言
TypeScript
星标
5.1k
派生
339
平均合并
12 小时 23 分钟
30 天内合并 PR
730

环境准备

  • 没有 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 摘要。