chore: P0 launch-flow fixes - #8
Merged
Merged
Conversation
added 2 commits
May 7, 2026 23:02
Captures the three-layer architecture (filesystem → agent runtime → derived index), the four cross-invariants enforced by tests, and the non-obvious gotchas (port 8765, cwd-bound skill loading, TAURI_BUILD flag, archive/ read-only convention, frozen-binary entry point) so future Claude Code sessions don't have to re-derive them.
- README quick start: port 8000→8765 and use `notebookai serve` for
consistency with the CLI.
- cli.py:serve restores stdlib + structlog logging via the same
_configure_logging path notebookai-api uses, so both entry points
behave identically (CLI module-import previously silenced logs).
- desktop/src-tauri/src/lib.rs bakes the absolute backend project dir
via env!("CARGO_MANIFEST_DIR") so the `uv run` fallback works no
matter what cwd the parent process launches from (cwd=/ in a
packaged .app).
- desktop/sidecar/build.py placeholder script resolves the backend
path via cd+pwd (POSIX) / for %%I in (...) (Windows) so it remains
cwd-independent.
- Extract claude_credentials_available to agent/credentials.py and
delegate from cli.py and AgentRuntime — single source of truth,
also picks up XDG_CONFIG_HOME for Linux.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three trivially-fixable launch-path bugs surfaced in the 2026-05-07 review, plus credential probe deduplication and a fresh
CLAUDE.md.8000→8765; swapnotebookai-api &fornotebookai servefor consistency with the Typer CLI.cli.py:servelogging: the CLI module silences stdlib + structlog to ERROR at import time;servepreviously skipped_configure_logging, sonotebookai serveran with logs hidden. Now routes through the same_configure_loggingpath thatnotebookai-apiuses.desktop/src-tauri/src/lib.rsbakes the backend path viaenv!("CARGO_MANIFEST_DIR"), anddesktop/sidecar/build.py's placeholder script resolves viacd + pwd(POSIX) /for %%I in (...)(Windows) so theuv runfallback works regardless of the parent's cwd (cwd=/ in a packaged.app).claude_credentials_available()intonotebookai/agent/credentials.py. Single source of truth; also picks upXDG_CONFIG_HOMEfor Linux.CLAUDE.md: project-level guidance for future Claude Code sessions — three-layer architecture, four cross-invariants, gotchas (port 8765, cwd-bound skill loading, frozen-binary entry point, etc).Test plan
cd backend && uv run pytest tests/ -m "not requires_claude"— 134/134 passcd backend && uv run ruff check— cleancd desktop/src-tauri && cargo check --quiet— cleancd backend && timeout 4 uv run notebookai serve— emits INFO logs (regression check)cd /tmp && desktop/src-tauri/binaries/notebookai-api-aarch64-apple-darwin— placeholder resolves backend from any cwd