Skip to content

fix: route compaction-summary lastUser.agent writes through normalizeAgentName #842

Description

@anandgupta42

Summary: v0.7.3 normalizes agent: "build""builder" at telemetry-emit boundary (PR #833). The fix is complete for emits, but three sites in session/prompt.ts still write lastUser.agent raw into persisted-state synthetic messages:

  • L615 — compaction summary user message
  • L654 — SessionCompaction.create
  • L1092 — SessionCompaction.create (second call site)

Persisted state therefore continues to record "build" for legacy-name calls; only telemetry is clean.

Recommended fix: Route those three sites through normalizeAgentName, OR add a one-shot migration on session load that rewrites "build""builder" in any historical row.

Acceptance: No new "build" rows enter persisted state on any code path; backfill optional.

Origin: Deferred from v0.7.3 release review (Tech Lead, P1).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions