Repository navigation
Fix console workspace changes across agents - #1779
Conversation
|
/kelos review |
|
🤖 Kelos Task Status Task |
|
🤖 Kelos Reviewer Agent @gjkim42 Review SummaryVerdict: COMMENT (sticky comment only) Findings Overview
FindingsCorrectness
Error reporting
Diff mapping
Cleanup
Key takeaways
|
There was a problem hiding this comment.
All reported issues were addressed across 11 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
dccd90f to
b470b00
Compare
|
Addressed the five Kelos findings and two applicable Cubic findings:
The two other Cubic findings were checked against the current code. Console requests already coalesce to one outstanding capture and reject stale request IDs. Transcript resets retain a valid workspace request; connection shutdown clears it through reconnect handling. Details are in the corresponding review threads. Validation passed: |
There was a problem hiding this comment.
1 issue found across 9 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="internal/sessionruntime/workspace_changes.go">
<violation number="1" location="internal/sessionruntime/workspace_changes.go:187">
P2: The file-count and encoded-list limits are applied only after Git’s complete name list is buffered and split, so a workspace with millions of changes can exhaust runtime memory despite the snapshot caps. Stream or cap the listing before materializing it, while retaining enough information for the truncation diagnostic.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| changes.Truncated = true | ||
| } | ||
| args := []string{"diff", "--no-ext-diff", "--no-textconv", "--no-color", "--no-renames", "--src-prefix=a/", "--dst-prefix=b/", base} | ||
| output, err := c.output(ctx, root, environment, append(args, "--name-only", "-z", "--")...) |
There was a problem hiding this comment.
P2: The file-count and encoded-list limits are applied only after Git’s complete name list is buffered and split, so a workspace with millions of changes can exhaust runtime memory despite the snapshot caps. Stream or cap the listing before materializing it, while retaining enough information for the truncation diagnostic.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At internal/sessionruntime/workspace_changes.go, line 187:
<comment>The file-count and encoded-list limits are applied only after Git’s complete name list is buffered and split, so a workspace with millions of changes can exhaust runtime memory despite the snapshot caps. Stream or cap the listing before materializing it, while retaining enough information for the truncation diagnostic.</comment>
<file context>
@@ -133,34 +168,55 @@ func (c *workspaceChangesCollector) capture(ctx context.Context) (WorkspaceChang
}
args := []string{"diff", "--no-ext-diff", "--no-textconv", "--no-color", "--no-renames", "--src-prefix=a/", "--dst-prefix=b/", base}
- output, err := c.command(ctx, root, environment, append(args, "--name-only", "-z", "--")...).Output()
+ output, err := c.output(ctx, root, environment, append(args, "--name-only", "-z", "--")...)
if err != nil {
return changes, fmt.Errorf("listing workspace changes: %w", err)
</file context>
b470b00 to
3091605
Compare
|
Fixed the failing Git 2.55.0 accepts an unborn nested repository into the intent-to-add index, then fails during patch generation with Validation passed locally: the full race-enabled unit suite, focused workspace tests with the race detector on Git 2.55.0, The PR remains squashed to one commit. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
The console Changes tab depends on provider diffs, so newly created files can be missing for Claude Code and OpenCode, reverted files can remain visible, and loading conversation history can change the list.
Use a shared runtime workspace snapshot for every provider. Compare against a persisted Git base, include committed, staged, unstaged, and non-ignored untracked files, and leave the user's staging area unchanged. Apply workspace snapshots independently of conversation diffs, preserving the displayed diff when a snapshot is unchanged. Refresh after connecting and completing turns, when opening Changes, and every five seconds while it is visible. Limit snapshots to 1,000 files, a bounded encoded file list, and 1 MiB of diff content so they stay below the console transport limit. Report truncation and Git diagnostics explicitly, and retain readable files when a nested repository has no commits. Git inspection failures do not prevent Sessions from starting.
The screenshots use the same browser fixture: an edited README and a newly created setup document.
Before — the new setup document is missing.
After — both files appear, with the comparison base displayed.
Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
fileDifffield and its computation are removed.make update,env -u CODEX_HOME -u CODEX_AUTH_JSON make test,make verify, andmake buildpassed. The environment exclusions isolate existing entrypoint tests from the running Codex session.Does this PR introduce a user-facing change?