Skip to content

Compress workerAPIRef to reduce token usage #25

@msoedov

Description

@msoedov

The workerAPIRef constant in internal/scheduler/scheduler.go:1018 is injected into every worker agent prompt. It contains 16 lines of padded API reference text that consumes tokens on every run.

Problem:
Every agent run pays for these tokens. With multiple agents running on cron, this adds up. The current format uses generous whitespace padding for alignment that LLMs don't need.

Suggested approach:

  • Strip alignment padding (e.g. GET $URL/api/v1/inbox - -> GET $URL/api/v1/inbox -)
  • Consider a more compact format (e.g. one-line-per-endpoint, no extra spaces)
  • Same treatment for ceoAPIRef at line 1054
  • Measure before/after token count

Acceptance criteria:

  • workerAPIRef and ceoAPIRef use minimal whitespace
  • No functional change to agent behavior (same endpoints, same descriptions)
  • Document token savings in PR description

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions