Skip to content

[FEATURE] Env/flag path to reminders config (so embedded consumers can stop writing ~/.infer/reminders.yaml) #733

Description

@inference-gateway-maintainer

Summary

The reminders system (config/reminders.go, RemindersConfig) is file-only: it loads from ~/.infer/reminders.yaml (or a project .infer/reminders.yaml) and falls back to DefaultRemindersConfig(). The only env override today is INFER_REMINDERS_ENABLED (master switch, in applyRemindersEnvOverrides). There is no way to supply the content of the reminders config via an env var or CLI flag — only via a file on disk.

This is a pain point for embedded/CI consumers (notably inference-gateway/infer-action) that compose reminders programmatically and currently have to write a file to ~/.infer/reminders.yaml before launching the CLI.

Proposal

Add a path to supply the reminders config content without writing a file. Two complementary options:

Option A — env var with inline YAML (preferred)

INFER_REMINDERS_CONFIG='enabled: true
reminders:
  - name: my-nudge
    hook: pre_stream
    trigger: interval
    interval: 5
    text: "..."
'

applyRemindersEnvOverrides (or the loader) would, when INFER_REMINDERS_CONFIG is set and non-empty, parse it as YAML and use it in place of the file-loaded RemindersConfig (precedence: env > project .infer/reminders.yaml > ~/.infer/reminders.yaml > built-in defaults). This mirrors how several other config sections already accept env overrides.

Option B — --reminders-file PATH flag

A flag pointing at an arbitrary file (not constrained to ~/.infer/) so a consumer can stage a temp file without touching the home dir. Less ergonomic for the action (still needs a temp file) but useful for infer run scripting.

A combination (env var for inline, flag for a custom path) would be ideal.

Why it matters

infer-action composes a reminders YAML tailored to each run context (issue vs PR vs fork, git-ops on/off, memory enabled, configurable cadence) and writes it to ~/.infer/reminders.yaml before invoking the CLI (infer-action PR #151, issue infer-action #144). Writing into ~/.infer/ from a CI job is fragile:

  • It can race with a user-managed ~/.infer/reminders.yaml on self-hosted runners (the action overwrites it).
  • It couples the action to the CLI's home-dir file-resolution order (a project .infer/reminders.yaml silently takes precedence and overrides the action's composed file, which is surprising in CI).
  • It forces the action to duplicate the CLI's built-in memory reminder texts (because a loaded file replaces the built-in list rather than merging) — an env/flag path doesn't fix the replace-vs-merge semantics on its own, but it removes the file-write footgun that makes the duplication mandatory today.

With INFER_REMINDERS_CONFIG, the action could pass its composed YAML inline and skip the file write entirely.

Related: a failure-gated reminder trigger

While here, the action would also benefit from a failure-gated post_tool trigger. The current trigger catalog (always, interval, turns_before_max, once) has no mode that fires only after a failed tool call — ReminderQuery carries no error/success field. The action wants a nudge that re-states the "a failed call means the change did not happen" rule only on failure, but today it must use always (firing after every tool call), which adds per-turn injection cost. Exposing the tool-call outcome on ReminderQuery (or adding a on_failure trigger) would let this fire only when it matters.

Acceptance criteria (suggested)

  • INFER_REMINDERS_CONFIG env var (inline YAML) is honored when set, overriding the file-loaded config with the same precedence rules as other env overrides
  • A --reminders-file PATH flag (or equivalent) for infer run / infer agent pointing at a non-home-dir file
  • ReminderQuery (or a new trigger) exposes tool-call failure so a post_tool reminder can fire only on failed calls
  • Docs updated in docs/configuration-reference.md and docs/commands-reference.md

Context

  • config/reminders.goRemindersConfig struct + DefaultRemindersConfig()
  • cmd/config.goapplyRemindersEnvOverrides (currently only INFER_REMINDERS_ENABLED)
  • config/config.goReminders field is yaml:"-" mapstructure:"-" (loaded separately from config.yaml)
  • internal/domain/interfaces.goSystemReminderProvider / ReminderQuery
  • internal/agent/agent_utils.goinjectDueReminders

Consuming side: inference-gateway/infer-action#144, infer-action#151.

Happy to contribute a PR if there's appetite for either option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Fields

    No fields configured for Feature.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions