Skip to content

chore: P0 launch-flow fixes - #8

Merged
flight505 merged 2 commits into
mainfrom
chore/p0-launch-fixes
May 9, 2026
Merged

chore: P0 launch-flow fixes#8
flight505 merged 2 commits into
mainfrom
chore/p0-launch-fixes

Conversation

@flight505

Copy link
Copy Markdown
Owner

Summary

Three trivially-fixable launch-path bugs surfaced in the 2026-05-07 review, plus credential probe deduplication and a fresh CLAUDE.md.

  • README quick-start: port 80008765; swap notebookai-api & for notebookai serve for consistency with the Typer CLI.
  • cli.py:serve logging: the CLI module silences stdlib + structlog to ERROR at import time; serve previously skipped _configure_logging, so notebookai serve ran with logs hidden. Now routes through the same _configure_logging path that notebookai-api uses.
  • Sidecar absolute paths: desktop/src-tauri/src/lib.rs bakes the backend path via env!("CARGO_MANIFEST_DIR"), and desktop/sidecar/build.py's placeholder script resolves via cd + pwd (POSIX) / for %%I in (...) (Windows) so the uv run fallback works regardless of the parent's cwd (cwd=/ in a packaged .app).
  • Credential probe: extracted claude_credentials_available() into notebookai/agent/credentials.py. Single source of truth; also picks up XDG_CONFIG_HOME for 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 pass
  • cd backend && uv run ruff check — clean
  • cd desktop/src-tauri && cargo check --quiet — clean
  • cd 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

Example User 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.
@flight505
flight505 merged commit 31c12f5 into main May 9, 2026
5 checks passed
@flight505
flight505 deleted the chore/p0-launch-fixes branch May 9, 2026 16:36
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