Top Of Mind ignores GOOSE_MOIM_MESSAGE_FILE set in config.yaml (env-var only, fails silently)
- Langage dominant
- Rust
- Étoiles
- 54.2k
- Forks
- 6.2k
- Merge moyen
- 3 j 2 h
- PR mergées (30 j)
- 262
Description
### Summary
The Top Of Mind (`tom`) platform extension reads its configuration with `std::env::var()` only. Setting `GOOSE_MOIM_MESSAGE_FILE` as a key in `~/.config/goose/config.yaml` therefore has no effect, because goose does not export config.yaml keys into the process environment. The extension loads, finds nothing, and silently injects nothing.
Every other `GOOSE_*` setting I have works from config.yaml (`GOOSE_MODE`, `GOOSE_THINKING_EFFORT`, `GOOSE_TELEMETRY_ENABLED`, etc.), so a `GOOSE_MOIM_MESSAGE_FILE` key sitting next to them looks like it should work. It fails with no error and no log line, which makes it hard to notice: the extension shows as enabled and the docs page for persistent instructions describes it purely in terms of environment variables.
### Steps to reproduce
1. Enable the `tom` extension in `config.yaml`.
2. Add to `config.yaml`:
```yaml
GOOSE_MOIM_MESSAGE_FILE: ~/.config/goose/top-of-mind.md
```
3. Fully quit and relaunch so `goosed` re-reads config.
4. Observe the `` block. It contains only the usual entries (current time, working directory). The file contents are absent.
### Expected
Either the key is read from config.yaml like other `GOOSE_*` settings, or goose logs that `tom` is enabled but has no message source configured.
### Actual
Silently skipped. `get_moim()` returns `None` because the env var does not exist in the process.
### Verification
- `ps eww ` shows 44 environment variables, including seven `GOOSE_*` vars injected by the host app, and no `MOIM` entry.
- `launchctl getenv GOOSE_MOIM_MESSAGE_FILE` is empty.
- `strings` on the shipped `goosed` binary contains `GOOSE_MOIM_MESSAGE_FILE`, confirming the env-var read path.
- The file itself is valid and well under the documented 64 KB cap; `~` expansion via `shellexpand::tilde` would have worked had the variable been set.
### Suggested fix
Read the setting through the config layer with an env-var fallback, so both work:
```rust
// crates/goose/src/agents/platform_extensions/tom.rs
let path = std::env::var("GOOSE_MOIM_MESSAGE_FILE").ok()
.or_else(|| Config::global().get_param("GOOSE_MOIM_MESSAGE_FILE").ok());
```
Same for `GOOSE_MOIM_MESSAGE_TEXT`. Failing that, a warning when `tom` is enabled with no resolvable source would have saved the debugging time.
### Notes
Related to #10262, which asks for Top Of Mind files to be discovered the way `.goosehints` files are. Config-layer support would be a natural step toward that.
Workaround in the meantime is `launchctl setenv GOOSE_MOIM_MESSAGE_FILE `, which does not survive a reboot.
### Environment
- goose bundled in Berd (`xyz.block.berd`), macOS 15
- provider databricks_v2, model goose-claude-opus-5
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.