Repository navigation
fix: pids が尽きて git を起こせなかった回の未 push 観測が、前に取れていた枝名を台帳から消さないようにする - #4398
Merged
Merged
Conversation
This was referenced Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #1266
何が残っていたか
#1266 の「取りに行く経路」(
closed/vacate/shutdown/stop/report/tool_use/ 退避 ref)は main に全部入っている。ただし pids が尽きて fork が断られる器(今日 heosterra の担当が何度も当たった形。#1334 / #2626)では、取りに行った観測そのものが前に取れていた枝名を台帳から消していた。computeUnpushedWorkは作業ツリーを readdir で探すので、fork できなくても作業ツリーは見つかる。一方git rev-parseなどは起こせないので、branch: nullでkind: 'observed'の観測になる。isUnpushedWorkObservationAtLeastAsNewAs)は時刻しか比べないため、この「より新しい観測」が、それより前のreport/tool_useで取れていた枝名をそのまま上書きしていた。closedの観測がまさにこの形になる。器が消えた後に台帳から引けるのはbranch=null(取れなかった)だけになる。変えたこと
#recordUnpushedWorkObservationとcase 'closed')で、新しい観測のbranch: nullの作業ツリーが前の観測では枝名を持っていたら、枝名を引き継ぐ。この観測で取れなかったremoteOriginも同じく引き継ぐ。引き継いだ時刻はbranchCarriedFromAtで名乗る。unpushedCommitCountUnknownなど)は引き継がない。この観測の「確かめられなかった」のまま残す。unavailableの観測へは引き継がない。欄の形が違い、「確かめられなかった」を観測で埋めないため。manager_list・CLI・Web の詳細・器の入れ替え後の nudge は、引き継いだ枝名に「◯◯時点の観測から引き継いだ」を添える。整形はdescribeObservedWorktreeBranchに寄せ、3か所で同じ文言にした。runGitは spawn の失敗(errorイベント)の errno code を返す。件数の理由は「git を起こせなかった: EAGAIN」になる。message はパスを含みうるので運ばない。apps/daemon/openapi.jsonをpnpm --filter "@alteroid/daemon..." buildで再生成した(欄が1つ増えただけ)。なぜ null の理由(detached HEAD か失敗か)で分けないか
runner の protocol に新しい欄を足せば分けられる。ただ、引き継いだ枝名は「
branchCarriedFromAtの時刻にはその枝だった」という意味で正しく、時刻を名乗るので嘘にはならない(rebase 途中の detached HEAD でも同じ)。runner と daemon の版のずれも持ち込まずに済む。確かめたこと(ローカル。2026-10-10T02:30Z)
pnpm --filter @alteroid/core --filter @alteroid/cli --filter @alteroid/web typecheckは緑。CLI は依存を build した後に緑になった。vitest runでmanager-closed-unpushed-work/unpushed-work/unpushed-work-observation-format/manager-workspace-nudge/manager-shutdown-unpushed-work/manager-abort-unpushed-workが 6 files / 143 tests 緑。prettier --checkとeslintを通した。closedが前の枝名と origin を引き継ぎ、時刻を名乗る。確かめていないこと
observedでbranch: null)の観測が台帳へ届いているか。根拠はコードの読みだけである。runGitは spawn の失敗を catch してexitCode: nullを返し、findGitDirsは readdir だけで fork しない。lastRescue)のbranchも、mergeRescueが新しい値で上書きするので、同じ回に null になりうる。退避 ref(pushed)は引き継がれるので取り戻す手順は残る。そのためこの PR では触っていない。Alteroid-Issue-Done: none