Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/codex-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5265,6 +5265,19 @@ assemble_candidate () {
"$candidate" "$state" "$require_automation"
fi

if test -f "$state/unstable/topic-updates"
then
recovered=$(state_value "$state/unstable" base-oid)
git merge-base --is-ancestor "$base_oid" "$recovered" &&
test "$(git rev-parse "$candidate^{tree}")" = \
"$(git rev-parse "$recovered^{tree}")" &&
codex_has_expected_integrations "$state" "$recovered" ||
die "completed unstable recovery has a different stable base"
# Keep the exact base of the recovered graph after validating its
# tree and integrations against the freshly assembled candidate.
candidate=$recovered
fi

printf '%s\n' "$candidate"
}

Expand Down
2 changes: 2 additions & 0 deletions t/t9905-codex-branch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9394,13 +9394,15 @@ test_expect_success 'pinned merge chain preserves recoverable overlap state' '
sh "$codex_branch" continue --worktree "$private" \
>continue.out 2>continue.err &&
test_grep "source refs unchanged" continue.out &&
test_tick &&
sh "$codex_branch" publish-topics --worktree resolution \
>publish.out 2>publish.err &&
test_grep "Pinned recovery session" publish.out &&
test_grep "No refs were updated" publish.out &&
session=$(sed -n \
"s/^Pinned recovery session: //p" publish.out) &&
test -n "$session" &&
test_cmp "$state/unstable/base-oid" "$session/codex-candidate" &&
sh "$codex_branch" verify-output \
--inputs "$session/codex-inputs" \
--updates "$session/codex-updates" \
Expand Down