aaif-goose / aaif-goose/goose

Top Of Mind ignores GOOSE_MOIM_MESSAGE_FILE set in config.yaml (env-var only, fails silently)

Abierto Apto para principiantes
#11,972 1 comentario 0 reacciones 1 asignado Reclamado por @DOsinga Ver en GitHub
Lenguaje dominante
Rust
Estrellas
54.2k
Forks
6.2k
Merge medio
3 d 4 h
PR fusionados (30 d)
240

Descripción

### 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

El issue está en crates/goose/src/agents/platform_extensions/tom.rs. Busca dónde se lee GOOSE_MOIM_MESSAGE_FILE mediante std::env::var. El fix es leer también desde Config::global().get_param. Revisa cómo se leen otros ajustes GOOSE_* desde config.yaml como referencia. Después de hacer el cambio, prueba habilitando la extensión y configurando la clave en config.yaml, luego verifica que el bloque incluya el contenido del archivo.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Área
backend
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Activo
Claridad
Bien especificado
Aptitud para principiantes
75/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.