Skip to content

Conversation

@blinkagent
Copy link
Contributor

@blinkagent blinkagent bot commented Dec 5, 2025

Summary

Adds CODER_AGENT_REPORT_METADATA_INTERVAL environment variable to control how often the workspace agent reports metadata to the Coder server.

Problem

The agent publishes metadata updates via pg_notify every 1 second by default. At scale with many agents, this can cause significant database load from the pubsub notifications.

Solution

Make the metadata report interval configurable via:

  • Environment variable: CODER_AGENT_REPORT_METADATA_INTERVAL
  • CLI flag: --report-metadata-interval

The default remains 1s for backwards compatibility, but operators experiencing database pressure from metadata updates can now increase this interval (e.g., 5s or 10s).

Changes

  • Added reportMetadataInterval variable to CLI agent command
  • Added ReportMetadataInterval to agent.Options initialization
  • Added new serpent option with env var CODER_AGENT_REPORT_METADATA_INTERVAL

Testing

  • Code compiles successfully

Add CODER_AGENT_REPORT_METADATA_INTERVAL env var to control how often
the agent reports metadata to the Coder server. This helps reduce
database load from pg_notify spam in deployments with many agents.

The default remains 1s for backwards compatibility, but operators can
now increase this interval if they experience database pressure from
metadata updates.
@blinkagent blinkagent bot changed the title feat(agent): add configurable metadata report interval feat(cli): add configurable agent metadata report interval Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant