Skip to content

chore: post-0.1.2 follow-up — codex P3 fix + README#21

Merged
enriquephl merged 1 commit into
mainfrom
chore/post-0.1.2-followup
May 19, 2026
Merged

chore: post-0.1.2 follow-up — codex P3 fix + README#21
enriquephl merged 1 commit into
mainfrom
chore/post-0.1.2-followup

Conversation

@enriquephl

Copy link
Copy Markdown
Member

Context

PR #20 (OpenRouter audit passthrough) shipped to the v0.1.2 prerelease without a codex-cli code review. This follow-up captures the codex review pass plus a README gap that landed alongside #20.

Both this follow-up and the upcoming model_config.toml fallback-array support will fold into the v0.1.3 cut. v0.1.2 stays as the audit-feature prerelease; v0.1.3 will be where the audit code matures (codex review applied + fallback array).

Codex review of 2b20dfa

`codex review --commit 2b20dfa` reported one P3:

The openrouter: call completed log only runs for chat requests that pass through pipeline::run. dreaming::classify_session and post_process::{extract_facts, extract_structured_insights} call openrouter.execute directly and only read resp.reply — their usage / generation_id / model fields are discarded. `docs/llm-audit.md` claims those background paths are covered by tracing; they weren't.

Fix:

  • Extracted log_openrouter_usage(task, session_id, &resp) as pub(super) fn in pipeline/mod.rs.
  • Called it from all 4 OpenRouter call sites with the appropriate task label (chat_companion, memory_extraction, or insight_extraction).
  • Threaded session_id: Uuid through extract_insightsextract_facts / extract_structured_insights so insight extraction logs carry session correlation.

`docs/llm-audit.md`'s claim is now honest. No tracing payload format change for the foreground chat path; just the helper extraction.

README

README.md and README.zh.md:

  • The /message[_async] bullet now lists both prompt_traits and audit with a link to docs/llm-audit.md / .zh.md.
  • Configuration table gains rows for OPENROUTER_APP_REFERER and OPENROUTER_APP_TITLE.

Out of scope

  • crates.io publish — still on 0.1.1 across the registry; no republish this cycle.
  • New tag — none; HEAD stays as 0.1.2 with this commit on top.
  • GHCR rebuild — skipped; deploy is straight from local source to fly.

Test plan

  • cargo build --workspace clean
  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test -p eros-engine-core -p eros-engine-llm --lib — 51/51 green
  • Post-merge: flyctl deploy --remote-only -a eros-engine from local source
  • Manual smoke: trigger a dreaming or insight-extraction event on staging; confirm a new openrouter: call completed log line appears with task = "memory_extraction" or task = "insight_extraction" (previously only task = "chat_companion" appeared)

🤖 Generated with Claude Code

PR #20 shipped to the v0.1.2 prerelease without a codex-cli review
pass. Re-ran codex on the squashed merge (commit 2b20dfa) and
captured one P3 finding plus a README gap.

## Codex P3 fix: extend usage tracing to background paths

Before this change, `pipeline::run`'s `openrouter: call completed`
tracing block only fired for the foreground chat path because the
log was inline in `run()`'s `match chat_req` arm. The two
background call sites — `pipeline::dreaming::classify_session`
and `pipeline::post_process::{extract_facts, extract_structured_insights}`
— call `state.openrouter.execute(req)` directly and only read
`resp.reply`, discarding `usage` / `generation_id` / `model`.

`docs/llm-audit.md` already promised that background paths emit
usage via tracing fields; the implementation didn't match that
claim. Fix:

- Extract `log_openrouter_usage(task, session_id, &resp)` as a
  `pub(super) fn` in `pipeline/mod.rs`.
- Call it from all 4 OpenRouter call sites with the appropriate
  task label (`chat_companion`, `memory_extraction`, or
  `insight_extraction`).
- Thread `session_id: Uuid` through `extract_insights` →
  `extract_facts` / `extract_structured_insights` so insight
  extraction logs also carry session correlation.

## README

`README.md` and `README.zh.md`:

- The `/message[_async]` bullet now lists both `prompt_traits` and
  `audit` (with a link to `docs/llm-audit.md` / `.zh.md`).
- Configuration table gains `OPENROUTER_APP_REFERER` and
  `OPENROUTER_APP_TITLE` rows.

## Out of scope

- crates.io publish skipped (still on 0.1.1 across registry).
- No new tag, no GHCR rebuild — deploy is straight from local
  source to fly.

This follow-up plus the upcoming `model_config.toml` fallback-array
support will both fold into the 0.1.3 cut.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@enriquephl enriquephl merged commit 88d725b into main May 19, 2026
6 checks passed
@enriquephl enriquephl deleted the chore/post-0.1.2-followup branch May 19, 2026 08:58
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.

1 participant