Skip to content

fix(settings): clone save payloads#1768

Merged
zerob13 merged 7 commits into
devfrom
bugfix/config-save
Jun 15, 2026
Merged

fix(settings): clone save payloads#1768
zerob13 merged 7 commits into
devfrom
bugfix/config-save

Conversation

@zerob13

@zerob13 zerob13 commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • serialize renderer settings payloads before config IPC invokes
  • normalize DeepChat Agent model selections to cloneable route values
  • restore MCP server auto-approve checkbox rendering and coverage

Tests

  • pnpm vitest --config vitest.config.renderer.ts test/renderer/api/clients.test.ts test/renderer/components/DeepChatAgentsSettings.test.ts test/renderer/components/McpServerForm.test.ts
  • pnpm run format
  • pnpm run i18n
  • pnpm run lint
  • commit hook: pnpm run typecheck

Summary by CodeRabbit

Release Notes

  • New Features

    • Added request diagnostics viewer with tabbed interface for viewing request parameters, view manifests, entry details, and token budgets in message traces
    • Added ability to export deterministic tape replay slices for individual messages for debugging and audit purposes
    • Restored editable auto-approve controls in MCP server add/edit forms
  • Bug Fixes

    • Fixed structured clone errors when saving settings with reactive proxy objects
    • Improved reliability of resume context handling with proper exclusion tracking
  • Documentation

    • Added architecture specifications for tape view system components and baseline implementation

@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds DeepChat tape view policy, assembler, manifest, and replay-slice contracts and runtime wiring, extends trace diagnostics UI to show manifests and budgets, adds supporting docs and tests, and separately fixes structured-clone settings saves, MCP auto-approve checkboxes, and a few typing/test setup updates.

Changes

DeepChat tape view manifests and replay export

Layer / File(s) Summary
Architecture and shared contracts
docs/architecture/deepchat-tape-*, docs/issues/deepchat-tape-view-manifest-pr-review/*, src/shared/contracts/..., src/shared/types/tape-*, src/shared/types/...agent-*.d.ts
Adds tape baseline, policy, assembler, manifest, provenance, and replay design docs, plus shared manifest/replay types and route or presenter contracts for diagnostics and replay export.
Context metadata and tape view assembly
src/main/presenter/agentRuntimePresenter/contextBuilder.ts, .../tapeViewPolicy.ts, .../tapeViewAssembler.ts, .../index.ts
Context builders now return included and excluded record metadata, policy selection is centralized, assembler helpers build chat and resume views, and runtime assembly switches to those results.
Manifest persistence and replay export
src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts, .../tapeService.ts, .../index.ts, src/main/presenter/agentSessionPresenter/index.ts, src/main/routes/index.ts, src/renderer/api/SessionClient.ts
Runtime streaming writes view/assembled manifests with request sequencing and policy provenance, tape service can list manifests and export replay slices, and presenter, route, and client APIs expose both features.
Trace diagnostics UI and locales
src/renderer/src/components/trace/TraceDialog.vue, src/renderer/src/i18n/*/traceDialog.json
TraceDialog becomes a tabbed diagnostics viewer for request traces and view manifests, including request selection, manifest entry and budget views, copy behavior, and locale strings for the new labels and empty states.
Tape runtime and UI coverage
test/main/presenter/agentRuntimePresenter/*, test/renderer/components/trace/TraceDialog.test.ts
Adds tests for metadata-producing context assembly, policy registry and assembler parity, manifest hashing and policy resolution, manifest persistence and replay export, runtime fallback behavior, and diagnostics UI states.

Settings payload clone safety

Layer / File(s) Summary
Settings serialization and model payloads
docs/issues/settings-save-clone-errors/*, src/renderer/api/ConfigClient.ts, src/renderer/settings/components/DeepChatAgentsSettings.vue
Adds a plain-value IPC serializer for settings writes and refactors DeepChat agent save payloads to build typed model-selection objects.
Settings save coverage
test/renderer/api/clients.test.ts, test/renderer/components/DeepChatAgentsSettings.test.ts
Tests assert saved settings payloads are structured-cloneable and that DeepChat agent model selections are preserved in saved config payloads.

MCP server auto-approve controls

Layer / File(s) Summary
Form controls and test
docs/issues/mcp-server-form-auto-approve-controls/*, src/renderer/src/components/mcp-config/*, test/renderer/components/McpServerForm.test.ts
Restores checkbox-based auto-approve controls, updates MCP form import casing and selector typing, and tests submitting read and write auto-approve values from edit mode.

Miscellaneous typing and test maintenance

Layer / File(s) Summary
Typing and test harness adjustments
src/renderer/settings/components/ProviderConfigImportDialog.vue, test/main/presenter/presenterCallErrorHandler.test.ts
Tightens one provider import dialog cast and updates presenter error-handler tests to initialize the event publisher through dynamic module loading.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~110 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • yyhhyyyyyy

Poem

🐇 I hopped through tapes of trace and view,
where manifests quietly bloomed anew.
A replay slice tucked in my pack,
with policy crumbs to guide me back.
And checkbox clovers, neat and bright,
made settings safe by moonlit night.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/config-save
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch bugfix/config-save

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 8

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/renderer/components/McpServerForm.test.ts (1)

38-122: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Test will fail: checkbox selector mismatch and missing Checkbox stub.

Line 108 attempts to find checkboxes with [data-slot="checkbox"], but the component template (lines 886, 900, 914 in mcpServerForm.vue) does not render this attribute. Additionally, there is no Checkbox stub defined in the test setup, so the real component will be used but likely won't match the selector.

The test will fail immediately at line 109 with expect(checkboxes).toHaveLength(3) returning 0 instead of 3.

🔧 Proposed fix: add Checkbox stub and update selector

Option 1 (recommended): Add Checkbox stub and use data-testid selector

Add a Checkbox stub to the stubs object (after line 103):

         SelectValue: passthrough('SelectValue')
+        Checkbox: defineComponent({
+          name: 'Checkbox',
+          props: {
+            checked: { type: Boolean, default: false },
+            disabled: { type: Boolean, default: false }
+          },
+          emits: ['update:checked'],
+          template: `<input type="checkbox" data-testid="checkbox" :checked="checked" :disabled="disabled" `@change`="$emit('update:checked', $event.target.checked)" />`
+        })
       }
     })

Then update the selector at line 108 to use data-testid:

-    const checkboxes = wrapper.findAll('[data-slot="checkbox"]')
+    const checkboxes = wrapper.findAll('[data-testid="checkbox"]')

Alternatively, update the template in mcpServerForm.vue to add data-testid="checkbox" to each Checkbox component:

     <Checkbox
       id="auto-approve-all"
       v-model:checked="autoApproveAll"
+      data-testid="checkbox"
       `@update`:checked="handleAutoApproveAllChange"
     />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/renderer/components/McpServerForm.test.ts` around lines 38 - 122, The
test attempts to find checkboxes using the selector [data-slot="checkbox"] but
the McpServerForm component template does not render this attribute, and there
is no Checkbox stub defined in the test setup. This causes the checkboxes array
to be empty at line 109 when expecting 3 items. Add a Checkbox stub to the
global stubs object in the mount configuration (after the existing stubs like
Button and Input around line 103), then update the selector at line 108 from
[data-slot="checkbox"] to [data-testid="checkbox"] to match the attribute that
should be rendered by the Checkbox component.
🧹 Nitpick comments (2)
src/renderer/src/components/mcp-config/mcpServerForm.vue (1)

1-628: ⚖️ Poor tradeoff

Filename should follow PascalCase convention for Vue components.

The component file mcpServerForm.vue should be renamed to McpServerForm.vue to comply with the project's Vue component naming guidelines. While this is a pre-existing issue not introduced by this PR, addressing it would improve consistency across the codebase.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/src/components/mcp-config/mcpServerForm.vue` around lines 1 -
628, Rename the component file from mcpServerForm.vue to McpServerForm.vue to
comply with the project's Vue component naming convention, which requires
PascalCase for component filenames. After renaming the file, search the entire
codebase for any import statements or references to mcpServerForm.vue and update
them to use the new filename McpServerForm.vue to ensure all module resolution
paths are correct.

Source: Coding guidelines

test/renderer/components/trace/TraceDialog.test.ts (1)

65-78: Make the Tabs stub stateful so tab-switch assertions are behaviorally meaningful.

The source component uses v-if="activeTab === 'request'" (and 'view', 'entries') on each TabsContent to conditionally render based on the active tab. However, the current mock renders TabsContent unconditionally and TabsTrigger only emits click, leaving tab-selection tests unable to detect regressions in tab state wiring.

♻️ Suggested stub update
 vi.mock(
   '`@shadcn/components/ui/tabs`',
   () => ({
-    Tabs: { name: 'Tabs', template: '<div><slot /></div>' },
-    TabsContent: { name: 'TabsContent', template: '<div><slot /></div>' },
+    Tabs: {
+      name: 'Tabs',
+      props: ['modelValue', 'defaultValue'],
+      emits: ['update:modelValue'],
+      data() {
+        return { active: this.modelValue ?? this.defaultValue ?? null }
+      },
+      watch: {
+        modelValue(value) {
+          this.active = value
+        }
+      },
+      provide() {
+        return {
+          __getActiveTab: () => this.active,
+          __setActiveTab: (value: string) => {
+            this.active = value
+            this.$emit('update:modelValue', value)
+          }
+        }
+      },
+      template: '<div><slot /></div>'
+    },
+    TabsContent: {
+      name: 'TabsContent',
+      inject: ['__getActiveTab'],
+      props: ['value'],
+      template: '<div v-if="!value || __getActiveTab() === value"><slot /></div>'
+    },
     TabsList: { name: 'TabsList', template: '<div><slot /></div>' },
     TabsTrigger: {
       name: 'TabsTrigger',
+      inject: ['__setActiveTab'],
       props: ['value'],
-      template: '<button `@click`="$emit(\'click\')"><slot /></button>'
+      template: '<button `@click`="__setActiveTab(value)"><slot /></button>'
     }
   }),
   { virtual: true }
 )

As per coding guidelines, tests should use Vitest with jsdom and Vue Test Utils; preserving minimal interaction semantics in stubs ensures those tests remain trustworthy and catch actual regressions.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/renderer/components/trace/TraceDialog.test.ts` around lines 65 - 78, The
Tabs mock stub currently renders all TabsContent unconditionally without
tracking which tab is active, preventing tests from verifying that the
v-if="activeTab === 'request'" conditionals in the source component work
correctly. Update the Tabs stub to maintain internal state for the active tab,
modify TabsTrigger to accept a value prop and emit a custom event (or update
parent state) when clicked to set the active tab, and modify TabsContent to
conditionally render only when its value prop matches the currently active tab.
This ensures that tab-switch assertions will detect actual regressions in tab
state wiring between the component and the UI framework.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/architecture/deepchat_tape_spec_v1.md`:
- Line 1: The architecture specification file currently violates the documented
naming convention by being placed as docs/architecture/deepchat_tape_spec_v1.md
instead of following the kebab-case goal-scoped folder structure. Move the file
to docs/architecture/<goal>/spec.md (where <goal> is a kebab-case folder name
such as deepchat-tape or similar that represents the goal or system being
documented), and then search the entire codebase for all references or links
pointing to the old deepchat_tape_spec_v1.md file path and update them to
reference the new location.

In `@src/main/presenter/agentRuntimePresenter/contextBuilder.ts`:
- Around line 925-932: The emergency truncation logic in the return statement
collapses all truncated messages into a single turn seeded from
remainingTurns[0], which destroys the per-turn record associations from any
additional turns in remainingTurns. Instead of returning a collapsed single-turn
structure, preserve the multi-turn structure and per-turn record mappings by
distributing the truncated messages back across the original turns while
maintaining each turn's individual record associations (selectedRecordIds,
includedRecords, excludedRecords) intact.

In `@src/main/presenter/agentRuntimePresenter/index.ts`:
- Line 2422: The `requestSeq` variable is reset to 0 at the start of
`runStreamForMessage()`, which causes the sequence to restart when
`resumeAssistantMessage()` re-enters the same method for the same `messageId`.
This breaks the monotonic ordering of the `(sessionId, messageId, requestSeq)`
tuple needed for correct manifest and replay sequencing. Instead of initializing
`requestSeq` to 0, seed it from the latest persisted sequence value for the
given `(sessionId, messageId)` pair, or maintain a per-message sequence counter
outside the `runStreamForMessage()` method that persists across resumptions.

In `@src/main/presenter/agentRuntimePresenter/tapeService.ts`:
- Around line 618-649: The sliceHash computation is including the wall-clock
time from createdAt (set via Date.now() on line 618), which causes different
hashes for the same manifest when re-exported at different times. To make the
replay slice hashing deterministic, remove the createdAt value from the payload
that gets hashed in the withReplaySliceHash function call. Move the createdAt
assignment to after the hash computation (after the withReplaySliceHash call on
line 649) so that the timestamp is recorded on the slice object but does not
affect the hash.

In `@src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts`:
- Around line 174-175: The createTapeViewManifest function is storing references
to input.included and input.excluded directly in the manifest snapshot. Instead
of assigning these properties by reference, create deep copies of the included
and excluded arrays when storing them in the manifest. This prevents post-build
mutations from desynchronizing the persisted content and breaking the integrity
guarantees tied to hashes.manifestHash.

In `@src/main/presenter/agentSessionPresenter/index.ts`:
- Around line 1459-1488: The exportMessageTapeReplaySlice method returns a
nullable type DeepChatTapeReplaySlice | null (accounting for cases where the
message doesn't exist, session isn't found, or the agent doesn't support tape
replay), but the corresponding sessions.exportMessageTapeReplaySlice route
contract defines the output as non-null. Align both contracts by updating the
route contract to accept nullable return values to match the actual runtime
behavior of the exportMessageTapeReplaySlice method, ensuring dispatch-time
parsing doesn't fail when null is legitimately returned.

In `@src/renderer/src/components/trace/TraceDialog.vue`:
- Around line 42-47: Replace the hardcoded fallback text `'-'` with a
localization key to ensure consistent translation across the application. In the
TraceDialog.vue file, update the fallback expressions for diagnosticProviderId
and diagnosticModelId (at lines 42-47 as the anchor location and at lines
603-608 as the sibling location) to use an i18n key such as
`traceDialog.notAvailable` instead of the hardcoded dash character. This ensures
all user-facing strings are properly internationalized per the coding
guidelines.

In `@src/renderer/src/i18n/zh-HK/traceDialog.json`:
- Line 16: The "model" label in the Chinese locale files has the English value
"Model" instead of being translated to Chinese. Replace the value of the "model"
key in src/renderer/src/i18n/zh-HK/traceDialog.json (line 16) with the proper
Chinese translation for "Model", and apply the same Chinese translation to the
"model" key in src/renderer/src/i18n/zh-TW/traceDialog.json to maintain
consistency across both Traditional Chinese locale variants.

---

Outside diff comments:
In `@test/renderer/components/McpServerForm.test.ts`:
- Around line 38-122: The test attempts to find checkboxes using the selector
[data-slot="checkbox"] but the McpServerForm component template does not render
this attribute, and there is no Checkbox stub defined in the test setup. This
causes the checkboxes array to be empty at line 109 when expecting 3 items. Add
a Checkbox stub to the global stubs object in the mount configuration (after the
existing stubs like Button and Input around line 103), then update the selector
at line 108 from [data-slot="checkbox"] to [data-testid="checkbox"] to match the
attribute that should be rendered by the Checkbox component.

---

Nitpick comments:
In `@src/renderer/src/components/mcp-config/mcpServerForm.vue`:
- Around line 1-628: Rename the component file from mcpServerForm.vue to
McpServerForm.vue to comply with the project's Vue component naming convention,
which requires PascalCase for component filenames. After renaming the file,
search the entire codebase for any import statements or references to
mcpServerForm.vue and update them to use the new filename McpServerForm.vue to
ensure all module resolution paths are correct.

In `@test/renderer/components/trace/TraceDialog.test.ts`:
- Around line 65-78: The Tabs mock stub currently renders all TabsContent
unconditionally without tracking which tab is active, preventing tests from
verifying that the v-if="activeTab === 'request'" conditionals in the source
component work correctly. Update the Tabs stub to maintain internal state for
the active tab, modify TabsTrigger to accept a value prop and emit a custom
event (or update parent state) when clicked to set the active tab, and modify
TabsContent to conditionally render only when its value prop matches the
currently active tab. This ensures that tab-switch assertions will detect actual
regressions in tab state wiring between the component and the UI framework.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 13d0e8c2-69ec-4055-a427-8f11971307f9

📥 Commits

Reviewing files that changed from the base of the PR and between a19e5d6 and c477e13.

📒 Files selected for processing (80)
  • docs/architecture/deepchat-tape-policy-provenance/plan.md
  • docs/architecture/deepchat-tape-policy-provenance/spec.md
  • docs/architecture/deepchat-tape-policy-provenance/tasks.md
  • docs/architecture/deepchat-tape-policy-selector/plan.md
  • docs/architecture/deepchat-tape-policy-selector/spec.md
  • docs/architecture/deepchat-tape-policy-selector/tasks.md
  • docs/architecture/deepchat-tape-replay-contract/plan.md
  • docs/architecture/deepchat-tape-replay-contract/spec.md
  • docs/architecture/deepchat-tape-replay-contract/tasks.md
  • docs/architecture/deepchat-tape-view-assembler/plan.md
  • docs/architecture/deepchat-tape-view-assembler/spec.md
  • docs/architecture/deepchat-tape-view-assembler/tasks.md
  • docs/architecture/deepchat-tape-view-manifest/plan.md
  • docs/architecture/deepchat-tape-view-manifest/spec.md
  • docs/architecture/deepchat-tape-view-manifest/tasks.md
  • docs/architecture/deepchat-tape-view-policy/plan.md
  • docs/architecture/deepchat-tape-view-policy/spec.md
  • docs/architecture/deepchat-tape-view-policy/tasks.md
  • docs/architecture/deepchat_tape_spec_v1.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/plan.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/spec.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/tasks.md
  • docs/issues/mcp-server-form-auto-approve-controls/plan.md
  • docs/issues/mcp-server-form-auto-approve-controls/spec.md
  • docs/issues/mcp-server-form-auto-approve-controls/tasks.md
  • docs/issues/settings-save-clone-errors/plan.md
  • docs/issues/settings-save-clone-errors/spec.md
  • docs/issues/settings-save-clone-errors/tasks.md
  • src/main/presenter/agentRuntimePresenter/contextBuilder.ts
  • src/main/presenter/agentRuntimePresenter/index.ts
  • src/main/presenter/agentRuntimePresenter/tapeService.ts
  • src/main/presenter/agentRuntimePresenter/tapeViewAssembler.ts
  • src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts
  • src/main/presenter/agentRuntimePresenter/tapeViewPolicy.ts
  • src/main/presenter/agentSessionPresenter/index.ts
  • src/main/routes/index.ts
  • src/renderer/api/ConfigClient.ts
  • src/renderer/api/SessionClient.ts
  • src/renderer/settings/components/DeepChatAgentsSettings.vue
  • src/renderer/settings/components/ProviderConfigImportDialog.vue
  • src/renderer/src/components/mcp-config/AgentMcpSelector.vue
  • src/renderer/src/components/mcp-config/mcpServerForm.vue
  • src/renderer/src/components/trace/TraceDialog.vue
  • src/renderer/src/i18n/da-DK/traceDialog.json
  • src/renderer/src/i18n/de-DE/traceDialog.json
  • src/renderer/src/i18n/en-US/traceDialog.json
  • src/renderer/src/i18n/es-ES/traceDialog.json
  • src/renderer/src/i18n/fa-IR/traceDialog.json
  • src/renderer/src/i18n/fr-FR/traceDialog.json
  • src/renderer/src/i18n/he-IL/traceDialog.json
  • src/renderer/src/i18n/id-ID/traceDialog.json
  • src/renderer/src/i18n/it-IT/traceDialog.json
  • src/renderer/src/i18n/ja-JP/traceDialog.json
  • src/renderer/src/i18n/ko-KR/traceDialog.json
  • src/renderer/src/i18n/ms-MY/traceDialog.json
  • src/renderer/src/i18n/pl-PL/traceDialog.json
  • src/renderer/src/i18n/pt-BR/traceDialog.json
  • src/renderer/src/i18n/ru-RU/traceDialog.json
  • src/renderer/src/i18n/tr-TR/traceDialog.json
  • src/renderer/src/i18n/vi-VN/traceDialog.json
  • src/renderer/src/i18n/zh-CN/traceDialog.json
  • src/renderer/src/i18n/zh-HK/traceDialog.json
  • src/renderer/src/i18n/zh-TW/traceDialog.json
  • src/shared/contracts/routes.ts
  • src/shared/contracts/routes/sessions.routes.ts
  • src/shared/types/agent-interface.d.ts
  • src/shared/types/presenters/agent-session.presenter.d.ts
  • src/shared/types/tape-replay.ts
  • src/shared/types/tape-view-manifest.ts
  • test/main/presenter/agentRuntimePresenter/agentRuntimePresenter.test.ts
  • test/main/presenter/agentRuntimePresenter/contextBuilder.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeService.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeViewAssembler.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeViewManifest.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeViewPolicy.test.ts
  • test/main/presenter/presenterCallErrorHandler.test.ts
  • test/renderer/api/clients.test.ts
  • test/renderer/components/DeepChatAgentsSettings.test.ts
  • test/renderer/components/McpServerForm.test.ts
  • test/renderer/components/trace/TraceDialog.test.ts

Comment thread docs/architecture/deepchat-tape-baseline/spec.md
Comment thread src/main/presenter/agentRuntimePresenter/contextBuilder.ts Outdated
Comment thread src/main/presenter/agentRuntimePresenter/index.ts Outdated
Comment thread src/main/presenter/agentRuntimePresenter/tapeService.ts
Comment thread src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts Outdated
Comment thread src/main/presenter/agentSessionPresenter/index.ts
Comment thread src/renderer/src/components/trace/TraceDialog.vue Outdated
Comment thread src/renderer/src/i18n/zh-HK/traceDialog.json Outdated
zerob13 added 2 commits June 15, 2026 22:31
Preserve tape view metadata across truncation and resumes, make replay slice hashing deterministic, localize trace fallbacks, and tighten MCP/TraceDialog tests.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/renderer/src/i18n/pt-BR/traceDialog.json (1)

1-53: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Register traceDialog in pt-BR locale index; these keys are currently unreachable.

The traceDialog namespace defined here won’t be used at runtime because src/renderer/src/i18n/pt-BR/index.ts does not import/export ./traceDialog.json. This breaks TraceDialog localization for pt-BR (e.g., Line 51-52 and the rest of this file).

Suggested fix
diff --git a/src/renderer/src/i18n/pt-BR/index.ts b/src/renderer/src/i18n/pt-BR/index.ts
@@
 import plan from './plan.json'
+import traceDialog from './traceDialog.json'
@@
   plan,
+  traceDialog,
   ...others
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/renderer/src/i18n/pt-BR/traceDialog.json` around lines 1 - 53, The
traceDialog.json file containing Portuguese Brazilian translations is not
registered in the pt-BR locale index. Import the traceDialog.json file in
src/renderer/src/i18n/pt-BR/index.ts and export it as part of the locale
namespace object so that the translations become accessible at runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@src/renderer/src/i18n/pt-BR/traceDialog.json`:
- Around line 1-53: The traceDialog.json file containing Portuguese Brazilian
translations is not registered in the pt-BR locale index. Import the
traceDialog.json file in src/renderer/src/i18n/pt-BR/index.ts and export it as
part of the locale namespace object so that the translations become accessible
at runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8c38f919-0454-4d01-9836-c8c79ece60be

📥 Commits

Reviewing files that changed from the base of the PR and between c477e13 and 1ff28ff.

📒 Files selected for processing (41)
  • docs/architecture/deepchat-tape-baseline/plan.md
  • docs/architecture/deepchat-tape-baseline/spec.md
  • docs/architecture/deepchat-tape-baseline/tasks.md
  • docs/architecture/deepchat-tape-policy-selector/plan.md
  • docs/architecture/deepchat-tape-view-assembler/plan.md
  • docs/architecture/deepchat-tape-view-policy/plan.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/plan.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/spec.md
  • docs/issues/deepchat-tape-view-manifest-pr-review/tasks.md
  • src/main/presenter/agentRuntimePresenter/contextBuilder.ts
  • src/main/presenter/agentRuntimePresenter/index.ts
  • src/main/presenter/agentRuntimePresenter/tapeService.ts
  • src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts
  • src/renderer/src/components/mcp-config/McpServerForm.vue
  • src/renderer/src/components/mcp-config/components/McpServers.vue
  • src/renderer/src/components/mcp-config/index.ts
  • src/renderer/src/components/trace/TraceDialog.vue
  • src/renderer/src/i18n/da-DK/traceDialog.json
  • src/renderer/src/i18n/de-DE/traceDialog.json
  • src/renderer/src/i18n/en-US/traceDialog.json
  • src/renderer/src/i18n/es-ES/traceDialog.json
  • src/renderer/src/i18n/fa-IR/traceDialog.json
  • src/renderer/src/i18n/fr-FR/traceDialog.json
  • src/renderer/src/i18n/he-IL/traceDialog.json
  • src/renderer/src/i18n/id-ID/traceDialog.json
  • src/renderer/src/i18n/it-IT/traceDialog.json
  • src/renderer/src/i18n/ja-JP/traceDialog.json
  • src/renderer/src/i18n/ko-KR/traceDialog.json
  • src/renderer/src/i18n/ms-MY/traceDialog.json
  • src/renderer/src/i18n/pl-PL/traceDialog.json
  • src/renderer/src/i18n/pt-BR/traceDialog.json
  • src/renderer/src/i18n/ru-RU/traceDialog.json
  • src/renderer/src/i18n/tr-TR/traceDialog.json
  • src/renderer/src/i18n/vi-VN/traceDialog.json
  • src/renderer/src/i18n/zh-CN/traceDialog.json
  • src/renderer/src/i18n/zh-HK/traceDialog.json
  • src/renderer/src/i18n/zh-TW/traceDialog.json
  • test/main/presenter/agentRuntimePresenter/tapeService.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeViewManifest.test.ts
  • test/renderer/components/McpServerForm.test.ts
  • test/renderer/components/trace/TraceDialog.test.ts
💤 Files with no reviewable changes (1)
  • src/renderer/src/components/mcp-config/McpServerForm.vue
✅ Files skipped from review due to trivial changes (16)
  • src/renderer/src/components/mcp-config/index.ts
  • docs/architecture/deepchat-tape-baseline/tasks.md
  • docs/architecture/deepchat-tape-baseline/spec.md
  • src/renderer/src/components/mcp-config/components/McpServers.vue
  • docs/architecture/deepchat-tape-baseline/plan.md
  • src/renderer/src/i18n/ru-RU/traceDialog.json
  • src/renderer/src/i18n/ko-KR/traceDialog.json
  • docs/architecture/deepchat-tape-view-policy/plan.md
  • src/renderer/src/i18n/da-DK/traceDialog.json
  • src/renderer/src/i18n/it-IT/traceDialog.json
  • docs/issues/deepchat-tape-view-manifest-pr-review/plan.md
  • src/renderer/src/i18n/tr-TR/traceDialog.json
  • src/renderer/src/i18n/he-IL/traceDialog.json
  • docs/architecture/deepchat-tape-view-assembler/plan.md
  • src/renderer/src/i18n/vi-VN/traceDialog.json
  • docs/issues/deepchat-tape-view-manifest-pr-review/spec.md
🚧 Files skipped from review as they are similar to previous changes (20)
  • src/renderer/src/i18n/ja-JP/traceDialog.json
  • src/renderer/src/i18n/id-ID/traceDialog.json
  • src/renderer/src/i18n/fa-IR/traceDialog.json
  • src/renderer/src/i18n/zh-TW/traceDialog.json
  • src/renderer/src/i18n/en-US/traceDialog.json
  • src/renderer/src/i18n/fr-FR/traceDialog.json
  • src/renderer/src/i18n/de-DE/traceDialog.json
  • src/renderer/src/i18n/es-ES/traceDialog.json
  • src/renderer/src/i18n/zh-HK/traceDialog.json
  • test/main/presenter/agentRuntimePresenter/tapeService.test.ts
  • test/main/presenter/agentRuntimePresenter/tapeViewManifest.test.ts
  • test/renderer/components/trace/TraceDialog.test.ts
  • src/renderer/src/i18n/zh-CN/traceDialog.json
  • src/renderer/src/i18n/pl-PL/traceDialog.json
  • test/renderer/components/McpServerForm.test.ts
  • src/main/presenter/agentRuntimePresenter/tapeViewManifest.ts
  • src/main/presenter/agentRuntimePresenter/tapeService.ts
  • src/renderer/src/components/trace/TraceDialog.vue
  • src/main/presenter/agentRuntimePresenter/contextBuilder.ts
  • src/main/presenter/agentRuntimePresenter/index.ts

@zerob13 zerob13 merged commit 32a3538 into dev Jun 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant