Skip to content

enhancement: local mode runs are not recorded in the activity log #155

@claude

Description

@claude

Problem

runLocalMode in cmd/run.go:256-305 emits the context bomb and writes to the display cache, but it does not append an entry to the activity log (via activitylog.Append) and has no cache store to call store.LogInjection on.

By contrast, the API-mode path in runHandler (lines 236-248) writes a full activity log entry after each successful injection.

This means local-mode runs are invisible in uncompact report and there is no way to track how often local mode is being used.

Impact

  • uncompact report shows no activity for users running in local mode (e.g., during initial setup before they have an API key).
  • Local-mode injection frequency cannot be compared to API-mode frequency.

Fix

At the end of runLocalMode, after fmt.Print(output), add an activitylog.Append call mirroring what runHandler does:

_ = activitylog.Append(activitylog.Entry{
    Timestamp:            time.Now().UTC(),
    Project:              proj.RootDir,
    ContextBombSizeBytes: len(output),
})

Note: there is no injection log entry (store.LogInjection) needed since there is no cache store in local mode; just the activity log is sufficient to track usage.

@claude please implement this

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions