Merge MCP server into the tempyr binary#2
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (10)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe changes convert Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
…on-miss in journal_get Three findings, all valid: 1. **`ingest_open_file` slurped the whole file**: `std::fs::read(path)` on a JSONL that's been growing across many agent invocations could OOM the indexer on very large sessions. Switched to `File::open` + `BufReader` + `seek(SeekFrom::Start(start))` and `read_until(b'\n')` to stream line-by-line, keeping memory bounded to one line buffer at a time. Partial-trailing-line behavior is preserved exactly: if the last line is missing its `\n` (writer mid-append), we stop *before* it and don't advance the offset, so the next refresh picks it up once the writer adds the newline. 2. **`read_last_offset` / `read_last_sha` swallowed all DB errors** via `.ok().flatten()`, hiding real problems (corrupt `indexer_state` table, locked db, etc.) behind silent re-ingestion. Switched to explicit match: `QueryReturnedNoRows` → `Ok(0)` / `Ok(None)` for first-time scans; everything else propagates. Distinguishes "no row yet" from real errors so a corrupted state surfaces instead of looking like a healthy fresh scan. 3. **`journal_get` returned null on cache miss without retrying**: an agent that called `journal_log` and then immediately called `journal_get(id)` would get null, because the indexer is the only writer and `journal_log` only appends to the JSONL. Fixed by adding a single refresh-on-miss retry. Re-opening the db alone wouldn't help — the index is the same. Calling `refresh_index` first ingests the new line, then the second `get_entry` hits. Bounded to exactly one retry; a still-missing id after refresh is a legitimate result (cross-machine entry not yet fetched). Two new regression tests: - `partial_trailing_line_is_left_for_next_refresh`: writes a complete line + a partial line (no `\n`), verifies refresh #1 ingests only the complete one and `j-partial` is absent. Then appends `\n` and verifies refresh #2 picks up the now-complete line. - `read_last_offset_returns_zero_for_first_time_scan`: pins the happy-path behavior of the new error-handling path so a future regression can't silently swallow errors again. Tests: 545 workspace-wide (+2 net). Clippy + fmt clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat: cross-encoder reranking on journal search (v2 backlog #2)
Summary
tempyrbinary behind an earlytempyr --mcplaunch pathtempyr-mcpfrom a standalone binary crate into an internal library withserve_stdio()Details
tempyr-clinow inspects raw args before clap parsing and routes--mcpinto MCP stdio mode--mcpare rejected instead of being ignoredtempyr-mcpexposes library entrypoints andTempyrServernow implementsDefaultcrates/tempyr-mcp/src/main.rsbinary entrypoint is removedtempyr-mcpas a library launched viatempyr --mcpVerification
cargo clippy -p tempyr-cli -p tempyr-mcp --all-targetscargo test --workspacecargo build --release -p tempyr-cli -F tempyr-index/local-embeddingsPackaging result
tempyr.exetempyr.exe + tempyr-mcp.exefootprint of64,291,328bytes to a singletempyr.exeat37,658,624bytesSummary by CodeRabbit
New Features
--mcpstartup mode to launch the MCP server over standard I/O.Documentation
tempyr --mcpoption.