feat:web端接入代码回退按键和功能,修复代码回退功能,还有优化界面#594
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
| runID := state.runID | ||
| state.mu.Unlock() | ||
|
|
||
| workdir := strings.TrimSpace(session.Workdir) |
There was a problem hiding this comment.
[high] This drift-rebase path uses session.Workdir directly, but Run() now does drift detection against agentsession.EffectiveWorkdir(...). For sessions that rely on the configured default workdir, session.Workdir is empty, so drift detection can fire while this function immediately returns workdir is empty, which disables the new rebase flow entirely for that common case. Please pass the effective workdir through here or normalize it the same way as the caller.
| } | ||
| if statePtr != nil { | ||
| runEndCtx := context.Background() | ||
| s.recordRunEndWorkspaceState(runEndCtx, statePtr.session.ID, statePtr.session.Workdir, statePtr.lastEndOfTurnCheckpointID) |
There was a problem hiding this comment.
[high] This persists the post-run fingerprint/baseline using statePtr.session.Workdir. If the session is using the default workdir fallback, that field is empty and recordRunEndWorkspaceState becomes a no-op, so the next run has no persisted fingerprint/baseline to compare against. That breaks the new cross-run drift detection/baseline recovery logic for default-workdir sessions. This should use the effective workdir that was already computed at run start (or store it on runState).
| _pendingRollbackAppliedRunId = undefined | ||
| } | ||
|
|
||
| const requestId = ++_latestRestoreSyncRequestId |
There was a problem hiding this comment.
[medium] Starting a restore reload here does not invalidate any in-flight _refreshRunFileChanges() requests. If an end-of-turn diff request from the pre-restore run resolves after this, it will still pass the current guards and call replaceFileChanges(...), repopulating the panel with stale pre-restore diffs. Please bump/cancel the run-diff request generation when a restore/undo sync begins.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
概要
本次变更围绕“代码回退”补齐前后端闭环,主要包括:
Rollback回退入口主要改动
Web 端
Rollback按钮,并增加二次确认弹窗bash_side_effect事件和文件项kind字段Runtime / Checkpoint
存储层
测试
备注
UI -> Gateway -> Runtime -> Checkpoint Store -> 状态回灌 -> UI