Skip to content

Commit 631d6ad

Browse files
paul-basanetsclaude
authored andcommitted
fix(dashboard): posix-normalize workspace_symbol_search result path
_workspace_match built the returned match path with str(Path(file_path).relative_to(root)), which yields backslash separators on Windows. The existing test only asserts the response shape, not the separator, so Windows CI didn't catch it. Normalize with .replace(os.sep, "/"), matching the sibling /code/* fixes. No-op on posix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 17ecc44 commit 631d6ad

16 files changed

Lines changed: 51 additions & 87 deletions

dashboard/src/components/overview/Timeline.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@
187187
gap: var(--space-2);
188188
}
189189
.ctrl {
190+
display: inline-flex;
191+
align-items: center;
192+
gap: var(--space-1);
190193
background: transparent;
191194
border: 1px solid var(--border);
192195
color: var(--text-primary);
@@ -205,6 +208,9 @@
205208
margin-bottom: var(--space-2);
206209
}
207210
.chip {
211+
display: inline-flex;
212+
align-items: center;
213+
gap: var(--space-1);
208214
background: transparent;
209215
border: 1px solid var(--border);
210216
color: var(--text-muted);

dashboard/src/components/overview/TimelineRow.svelte

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@
167167
{showFullInput ? 'Show less' : 'Show full'}
168168
</button>
169169
{/if}
170-
{#if record.input_truncated}
171-
<div class="note">(server-truncated at 8 KB)</div>
172-
{/if}
173170
</div>
174171
<div class="block">
175172
<div class="block-head">
@@ -192,9 +189,6 @@
192189
{showFullOutput ? 'Show less' : 'Show full'}
193190
</button>
194191
{/if}
195-
{#if record.output_truncated}
196-
<div class="note">(server-truncated at 8 KB)</div>
197-
{/if}
198192
</div>
199193
</div>
200194
{:else}
@@ -391,10 +385,6 @@
391385
cursor: pointer;
392386
padding: 0;
393387
}
394-
.note {
395-
color: var(--text-muted);
396-
font-size: 0.85em;
397-
}
398388
.err {
399389
color: var(--log-error);
400390
}

dashboard/src/lib/api/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ export interface ToolCallRecord {
156156
error_message: string | null;
157157
input_preview: string;
158158
output_preview: string;
159-
input_truncated: boolean;
160-
output_truncated: boolean;
161159
input_tokens: number;
162160
output_tokens: number;
163161
}

dashboard/tests/charts.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,6 @@ function rec(started_at: number, tool = 't'): ToolCallRecord {
127127
error_message: null,
128128
input_preview: '',
129129
output_preview: '',
130-
input_truncated: false,
131-
output_truncated: false,
132130
input_tokens: 0,
133131
output_tokens: 0,
134132
};

dashboard/tests/timeline-row.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ function historyRow(over: Partial<ToolCallRecord> = {}): TimelineDisplayRow {
1414
error_message: null,
1515
input_preview: "{'relative_path': 'src/foo.py', 'flag': True}",
1616
output_preview: 'file contents here',
17-
input_truncated: false,
18-
output_truncated: false,
1917
input_tokens: 1234,
2018
output_tokens: 340,
2119
...over,

dashboard/tests/timeline-rows.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ function rec(seq: number, tool: string, started_at: number, success = true): Too
1212
error_message: null,
1313
input_preview: '',
1414
output_preview: '',
15-
input_truncated: false,
16-
output_truncated: false,
1715
input_tokens: 0,
1816
output_tokens: 0,
1917
};

dashboard/tests/timeline-store.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ function record(seq: number, tool = 't'): ToolCallRecord {
1515
error_message: null,
1616
input_preview: '',
1717
output_preview: '',
18-
input_truncated: false,
19-
output_truncated: false,
2018
input_tokens: 0,
2119
output_tokens: 0,
2220
};
@@ -57,8 +55,6 @@ describe('timeline store', () => {
5755
error_message: null,
5856
input_preview: '',
5957
output_preview: '',
60-
input_truncated: false,
61-
output_truncated: false,
6258
input_tokens: 0,
6359
output_tokens: 0,
6460
},

dashboard/tests/timeline.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ function rec(seq: number, tool = 'read_file', success = true): ToolCallRecord {
1515
error_message: success ? null : 'Err',
1616
input_preview: `in${seq}`,
1717
output_preview: `out${seq}`,
18-
input_truncated: false,
19-
output_truncated: false,
2018
input_tokens: seq * 10,
2119
output_tokens: seq * 20,
2220
};

src/serena/analytics.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,9 @@ def load_estimator(self) -> TokenCountEstimator:
116116
return estimator_instance
117117

118118

119-
_INPUT_OUTPUT_PREVIEW_BYTES = 8 * 1024
120119
_RECORD_BUFFER_SIZE = 2000
121120

122121

123-
def _truncate_preview(text: str) -> tuple[str, bool]:
124-
"""
125-
Truncate text so its UTF-8 byte length is at most _INPUT_OUTPUT_PREVIEW_BYTES.
126-
Returns (possibly-truncated text, was_truncated).
127-
"""
128-
encoded = text.encode("utf-8")
129-
if len(encoded) <= _INPUT_OUTPUT_PREVIEW_BYTES:
130-
return text, False
131-
truncated = encoded[:_INPUT_OUTPUT_PREVIEW_BYTES].decode("utf-8", errors="ignore")
132-
return truncated, True
133-
134-
135122
@dataclass(frozen=True)
136123
class ToolCallRecord:
137124
seq: int
@@ -142,8 +129,6 @@ class ToolCallRecord:
142129
error_message: str | None
143130
input_preview: str
144131
output_preview: str
145-
input_truncated: bool
146-
output_truncated: bool
147132
input_tokens: int
148133
output_tokens: int
149134

@@ -226,8 +211,6 @@ def record_call(
226211
"""
227212
input_tokens = self._estimate_token_count(input_str)
228213
output_tokens = self._estimate_token_count(output_str)
229-
input_preview, input_truncated = _truncate_preview(input_str)
230-
output_preview, output_truncated = _truncate_preview(output_str)
231214
with self._tool_stats_lock:
232215
self._seq_counter += 1
233216
seq = self._seq_counter
@@ -246,10 +229,8 @@ def record_call(
246229
duration_ms=duration_ms,
247230
success=success,
248231
error_message=error_message,
249-
input_preview=input_preview,
250-
output_preview=output_preview,
251-
input_truncated=input_truncated,
252-
output_truncated=output_truncated,
232+
input_preview=input_str,
233+
output_preview=output_str,
253234
input_tokens=input_tokens,
254235
output_tokens=output_tokens,
255236
)

src/serena/dashboard.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,6 @@ class ToolCallRecordResponse(BaseModel):
160160
error_message: str | None
161161
input_preview: str
162162
output_preview: str
163-
input_truncated: bool
164-
output_truncated: bool
165163
input_tokens: int
166164
output_tokens: int
167165

@@ -342,8 +340,6 @@ def get_tool_call_timeline_route() -> tuple[dict[str, Any], int] | dict[str, Any
342340
error_message=r.error_message,
343341
input_preview=r.input_preview,
344342
output_preview=r.output_preview,
345-
input_truncated=r.input_truncated,
346-
output_truncated=r.output_truncated,
347343
input_tokens=r.input_tokens,
348344
output_tokens=r.output_tokens,
349345
)

0 commit comments

Comments
 (0)