Context
PR #132 (feat/issue-126) has critical bugs. Fix on branch feat/issue-126.
Bugs to fix
1. ISO8601 ts field parsed as integer (cloud_monitor.zig)
std.fmt.parseInt(i64, ts_str, 10) always fails on ISO8601 strings like "2024-03-11T12:34:56Z". Fix: just use server timestamp always (simplest), or parse the ISO8601 string properly.
// Simplest fix — always use server time:
const ts = std.time.timestamp();
// Remove the broken parseInt attempt entirely
2. extractJsonPayload bounds check missing
// BEFORE (can panic):
if (body[start] == '{') {
// AFTER:
if (start < body.len and body[start] == '{') {
3. getMetricsJson buffer too small
// BEFORE:
var buf: [4096]u8 = undefined;
// AFTER:
var buf: [16384]u8 = undefined;
4. Remove CLAUDE.md.agent from repo
git rm CLAUDE.md.agent
echo "CLAUDE.md.agent" >> .gitignore
5. Remove dead code
Remove unused structs: ACIEvent (keep only EventType enum), MetricPayload, formatIso8601 function.
Instructions
git checkout feat/issue-126
- Apply fixes to
tools/mcp/trinity_mcp/cloud_monitor.zig
- Remove
CLAUDE.md.agent, add to .gitignore
zig fmt tools/
- Commit:
fix(cloud): ISO8601 parse, bounds check, buffer size, remove dead code (#132)
- Push to
feat/issue-126
Context
PR #132 (feat/issue-126) has critical bugs. Fix on branch
feat/issue-126.Bugs to fix
1. ISO8601 ts field parsed as integer (cloud_monitor.zig)
std.fmt.parseInt(i64, ts_str, 10)always fails on ISO8601 strings like "2024-03-11T12:34:56Z". Fix: just use server timestamp always (simplest), or parse the ISO8601 string properly.2. extractJsonPayload bounds check missing
3. getMetricsJson buffer too small
4. Remove CLAUDE.md.agent from repo
5. Remove dead code
Remove unused structs:
ACIEvent(keep only EventType enum),MetricPayload,formatIso8601function.Instructions
git checkout feat/issue-126tools/mcp/trinity_mcp/cloud_monitor.zigCLAUDE.md.agent, add to.gitignorezig fmt tools/fix(cloud): ISO8601 parse, bounds check, buffer size, remove dead code (#132)feat/issue-126