aaif-goose / aaif-goose/goose

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

Đang mở Phù hợp với người mới
#11,972 1 bình luận 0 reaction 1 người được giao Được @DOsinga nhận Xem trên GitHub
Ngôn ngữ chính
Rust
Star
54.2k
Fork
6.2k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
240

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

The issue is in crates/goose/src/agents/platform_extensions/tom.rs. Look for where GOOSE_MOIM_MESSAGE_FILE is read via std::env::var. The fix is to also read from Config::global().get_param. Check how other GOOSE_* settings are read from config.yaml for reference. After making the change, test by enabling the extension and setting the key in config.yaml, then verifying the block includes the file contents.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Lĩnh vực
backend
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Đặc tả rõ ràng
Mức phù hợp với người mới
75/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.