Skip to content

fix: create logs dir before writing llm request log#8522

Merged
jh-block merged 1 commit intoaaif-goose:mainfrom
J-Palomino:fix/request-log-missing-logs-dir
Apr 16, 2026
Merged

fix: create logs dir before writing llm request log#8522
jh-block merged 1 commit intoaaif-goose:mainfrom
J-Palomino:fix/request-log-missing-logs-dir

Conversation

@J-Palomino
Copy link
Copy Markdown
Contributor

Summary

RequestLog::start opened <state>/logs/llm_request.<uuid>.jsonl with File::create, which creates the file but not its parent directory. On fresh installs (or when the logs/ directory was cleared), every provider streaming request failed with ENOENT, and the providers::ollama::tests::test_stream_ollama_timeout_on_stall test panicked at the RequestLog::start(...).unwrap() call.

This change calls fs_err::create_dir_all on the logs directory at the top of RequestLog::start so the rename in finish() and the file write here both have a guaranteed parent. The existing workaround in crates/goose-acp/tests/fixtures/mod.rs (which pre-creates the dir before tests run) is no longer load-bearing.

Testing

  • Added providers::utils::tests::test_request_log_start_creates_logs_dir — points GOOSE_PATH_ROOT at a fresh tempdir, asserts logs/ does not exist, calls RequestLog::start, asserts it now exists. Uses the same env_lock pattern as providers::init::tests.
  • cargo test -p goose --lib providers::utils::tests::test_request_log_start_creates_logs_dir -- --exact — passes.
  • cargo fmt --check -p goose — clean.
  • cargo clippy -p goose --lib --tests -- -D warnings — clean.

Related Issues

Fixes #8485

RequestLog::start opened <state>/logs/llm_request.<uuid>.jsonl with
File::create, which creates the file but not its parent directory. On
fresh installs (or when the logs dir was cleared), every provider
streaming request failed with ENOENT, and the
test_stream_ollama_timeout_on_stall test panicked.

Call fs_err::create_dir_all on the logs dir at the top of
RequestLog::start so callers no longer need to pre-create it.

Signed-off-by: Juan Palomino <jpalomino09@gmail.com>
@jh-block jh-block added this pull request to the merge queue Apr 16, 2026
Merged via the queue into aaif-goose:main with commit aa8ea99 Apr 16, 2026
19 checks passed
jh-block added a commit to sunilkumarvalmiki/goose that referenced this pull request Apr 16, 2026
…l-placeholder

* origin/main: (64 commits)
  fix: expand tool calls by default when Response Style is Detailed (aaif-goose#8478)
  fix: create logs dir before writing llm request log (aaif-goose#8522)
  fix: enable token usage tracking and configurable stream timeout for Ollama provider (aaif-goose#8493)
  fix tauri-plugin-dialog version constraint to match other plugins (aaif-goose#8542)
  call goose serve from tauri frontend via goose-acp client (aaif-goose#8549)
  failed the script when bundle:default fails and cleanup "alpha"  (aaif-goose#8580)
  pass globally unique conversation identifier as sessionId in databricks api call (aaif-goose#8576)
  fix: use sqlx chrono decode for thread timestamps instead of manual parsing (aaif-goose#8575)
  docs: remove stale gemini-acp references (aaif-goose#8572)
  show individual untracked files in git changes widget (aaif-goose#8574)
  fix: update publishing flow to include new sdk dir (aaif-goose#8573)
  fix: remove double border on content in chat (aaif-goose#8545)
  chore(goose2): `just goose2 <command>` with the addition of `just goose2 kill` (aaif-goose#8570)
  Lifei/oltp data (aaif-goose#8458)
  Sidebar polish: search copy, dividers, project reorder, fix DnD (aaif-goose#8568)
  remove the workflow_dispatch check (aaif-goose#8563)
  fix: one more rename (aaif-goose#8562)
  fix(desktop): accept self-signed certs from configured external goosed host (aaif-goose#8400)
  alexhancock/npm-bumps (aaif-goose#8557)
  Remove npm publish from release for now (aaif-goose#8558)
  ...
michaelneale added a commit that referenced this pull request Apr 17, 2026
* main: (37 commits)
  polish: refine sidebar activity indicators, add placeholder token, and tidy search field (#8606)
  feat: add /edit command to cli for on-demand prompt editing (#8566)
  docs(mcp): add Rendex MCP Server extension tutorial (#8541)
  Lifei/delete tauri backend acp (#8582)
  chore: set goose binaries as executable in package.json (#8589)
  feat: add Novita AI as declarative provider (#8432)
  feat: add Kimi Code provider with OAuth device flow authentication (#8466)
  fix: chat loading-state model placeholder (#8431)
  fix: expand tool calls by default when Response Style is Detailed (#8478)
  fix: create logs dir before writing llm request log (#8522)
  fix: enable token usage tracking and configurable stream timeout for Ollama provider (#8493)
  fix tauri-plugin-dialog version constraint to match other plugins (#8542)
  call goose serve from tauri frontend via goose-acp client (#8549)
  failed the script when bundle:default fails and cleanup "alpha"  (#8580)
  pass globally unique conversation identifier as sessionId in databricks api call (#8576)
  fix: use sqlx chrono decode for thread timestamps instead of manual parsing (#8575)
  docs: remove stale gemini-acp references (#8572)
  show individual untracked files in git changes widget (#8574)
  fix: update publishing flow to include new sdk dir (#8573)
  fix: remove double border on content in chat (#8545)
  ...
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.

Ollama stall-timeout path panics on missing llm_request log file

2 participants