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

deploy: bind Agent Runtime updates to recorded resource identity

已关闭
#75 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@asrujana-44 已经在做这个了。

开始于 2026年9月14日。

评估

这个 Issue 还没有评估数据。

描述

Summary

Agent Runtime updates are selected by display_name on the v1.3.1 source baseline. A display name is not a unique resource identity, so an update can target an arbitrary same-name Reasoning Engine.

Baseline: 5a306f8956cb1eeae69f9709de0e4d61b44e11e7 (v1.3.1).

Reproduction

  1. Deploy an agent_runtime project and keep its generated deployment_metadata.json.
  2. Create a second Reasoning Engine in the same project/location with the same display name.
  3. Run agents-cli deploy again.
  4. Separately, remove the metadata file and repeat with 0, 1, and 2 same-name resources.

Actual behavior

The baseline lists by display name and uses the first match. With duplicate names, selection depends on list order and a mutation may be sent to the wrong resource.

Expected behavior

  1. If deployment_metadata.json.remote_agent_runtime_id exists, fetch exactly that resource by ID.
  2. Before mutation, validate its project number, location, deployment target, resource name, and actual display name.
  3. Reject stale or inconsistent metadata.
  4. Only without usable metadata: create for 0 matches, update for exactly 1 match, and reject 2+ matches before any create/update API call.
  5. Revalidate after acquiring the local deployment-operation claim so a concurrently changed target cannot be mutated.

Minimal fix

Resolve the target in one shared selector that prefers the recorded resource ID and fails closed on every mismatch. Treat display-name lookup only as the metadata-free fallback and require it to be unambiguous. Atomically update metadata only after a successful mutation.

Reference implementation and regressions: fork Batch 4 branch.

Verification evidence

  • Targeted identity/lifecycle suite: 35 tests passed under a fresh reviewer; full local suite: 92 passed.
  • Multiple same-name case asserted zero calls to create/update/identity-create.
  • Disposable isolated GCP project acceptance:
    • create returned one recorded resource ID;
    • update retained the same resource ID;
    • after temporarily removing metadata and creating a second same-name resource, the CLI rejected before mutation;
    • cleanup found 0 Reasoning Engines and 0 unfinished operations;
    • project lifecycle was confirmed as DELETE_REQUESTED.
  • ruff check src tests, ty check src, build, and Python 3.11/3.13 installed-wheel smoke tests passed.
主要语言
Python
星标
6k
派生
670
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

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

google/agents-cli 的其他 Issue

查看 google/agents-cli 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

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