Skip to content

fix(cloud): PR #132 bugs — ISO8601 parse, bounds check, dead code, CLAUDE.md.agent #136

@gHashTag

Description

@gHashTag

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

  1. git checkout feat/issue-126
  2. Apply fixes to tools/mcp/trinity_mcp/cloud_monitor.zig
  3. Remove CLAUDE.md.agent, add to .gitignore
  4. zig fmt tools/
  5. Commit: fix(cloud): ISO8601 parse, bounds check, buffer size, remove dead code (#132)
  6. Push to feat/issue-126

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions