Fix project automation Qodo follow-ups#166
Conversation
Review Summary by QodoHarden project automation TOML parsing and API responses
WalkthroughsDescription• Harden TOML array parsing to support single-quoted strings • Omit internal TOML metadata from automation API responses • Refresh project automations after save/delete operations • Add dark theme styling for sidebar automation chips Diagramflowchart LR
A["TOML Parser"] -->|"parse single-quoted arrays"| B["parseTomlStringArray()"]
B -->|"create automation record"| C["parseAutomationToml()"]
C -->|"filter internal metadata"| D["toAutomationApiRecord()"]
D -->|"return to API"| E["API Endpoints"]
F["Project Automation UI"] -->|"save/delete"| G["reloadProjectAutomations()"]
G -->|"refresh state"| H["automationByProjectName"]
H -->|"update all affected rows"| I["Sidebar Display"]
J["Dark Theme"] -->|"apply styling"| K[".thread-row-automation-chip"]
File Changes1. src/server/codexAppServerBridge.ts
|
Code Review by Qodo
1. No performance audit documented
|
| function parseTomlStringArray(value: string): string[] { | ||
| const trimmed = value.trim() | ||
| if (!trimmed.startsWith('[') || !trimmed.endsWith(']')) return [] | ||
| try { | ||
| const parsed = JSON.parse(trimmed) | ||
| return Array.isArray(parsed) | ||
| ? parsed.filter((item): item is string => typeof item === 'string' && item.trim().length > 0) | ||
| : [] | ||
| } catch { | ||
| return [] | ||
| const values: string[] = [] | ||
| let index = 1 | ||
| const endIndex = trimmed.length - 1 | ||
|
|
||
| while (index < endIndex) { | ||
| while (index < endIndex && /[\s,]/u.test(trimmed[index] ?? '')) index += 1 | ||
| if (index >= endIndex) break | ||
|
|
||
| const quote = trimmed[index] | ||
| if (quote !== '"' && quote !== "'") return [] | ||
| const start = index | ||
| index += 1 | ||
| let valueText = '' | ||
|
|
||
| if (quote === "'") { | ||
| const closeIndex = trimmed.indexOf("'", index) | ||
| if (closeIndex < 0 || closeIndex > endIndex) return [] | ||
| valueText = trimmed.slice(index, closeIndex) | ||
| index = closeIndex + 1 | ||
| } else { | ||
| let escaped = false | ||
| while (index < endIndex) { | ||
| const char = trimmed[index] ?? '' | ||
| if (escaped) { | ||
| escaped = false | ||
| } else if (char === '\\') { | ||
| escaped = true | ||
| } else if (char === '"') { | ||
| break | ||
| } | ||
| index += 1 | ||
| } | ||
| if (index >= endIndex || trimmed[index] !== '"') return [] | ||
| try { | ||
| valueText = JSON.parse(trimmed.slice(start, index + 1)) as string | ||
| } catch { | ||
| return [] | ||
| } | ||
| index += 1 | ||
| } | ||
|
|
||
| if (valueText.trim().length > 0) values.push(valueText) | ||
| while (index < endIndex && /\s/u.test(trimmed[index] ?? '')) index += 1 | ||
| if (index < endIndex && trimmed[index] !== ',') return [] | ||
| } | ||
|
|
||
| return values |
There was a problem hiding this comment.
1. No performance audit documented 📘 Rule violation ➹ Performance
This PR introduces behavior changes (new TOML array parsing and automation API response shaping) without an accompanying measurement- or analysis-grounded performance audit. This risks unnoticed regressions (e.g., payload bloat, extra requests, or slower routes) in the affected automation flows.
Agent Prompt
## Issue description
PR Compliance ID 7 requires a performance audit for any feature/behavior change, grounded in measurements or explicit code-path analysis. This PR changes automation parsing and API response behavior, but does not include any performance-audit writeup.
## Issue Context
The changes affect automation listing/parsing and API payload shaping (potential request count/payload size/CPU parsing impacts). The audit should state what was measured (or why measurement wasn’t feasible) and include concrete results (e.g., request counts, response sizes, timing/profiler output) or a clear code-path analysis with next measurement steps.
## Fix Focus Areas
- src/server/codexAppServerBridge.ts[3275-3324]
- src/server/codexAppServerBridge.ts[3430-3451]
- src/server/codexAppServerBridge.ts[7317-7444]
- src/components/sidebar/SidebarThreadTree.vue[2267-2275]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Performance audit for the automation follow-up changes:
Additional verification:
|
|
/review |
|
Persistent review updated to latest commit cc7c112 |
Summary
Verification