Skip to content

release: v0.2.0a0 - CLI restructure and package rename - #24

Merged
neuromechanist merged 11 commits into
mainfrom
develop
Jan 10, 2026
Merged

neuromechanist merged 11 commits into
mainfrom
develop

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

Major release preparing for PyPI publication.

Changes

CLI Restructure

  • New pattern: osa <assistant> <command> instead of osa <command> --assistant
  • Running bare osa shows available assistants with status
  • Each assistant has own subcommand group (ask, chat)

Package Rename

  • PyPI package: open-science-assistant (osa was taken)
  • CLI command remains osa

CI/CD

  • Added auto-release workflow for version tags
  • Added Python 3.13 to test matrix
  • Updated PyPI/TestPyPI URLs

Documentation

  • Updated README with new CLI examples

Test Plan

  • All 385 tests pass
  • CLI commands work correctly
  • Package builds successfully

CLI Changes:
- Restructure from `osa ask --assistant hed` to `osa hed ask`
- Add assistants registry with status (available/coming soon)
- Running bare `osa` now shows available assistants
- Each assistant has own subcommand group with ask/chat commands

Package Changes:
- Rename from `osa` to `open-science-assistant` (osa taken on PyPI)
- CLI command remains `osa` for usability
- Update CI workflow URLs for new package name
…cture

feat: restructure CLI and rename package to open-science-assistant
@neuromechanist

Copy link
Copy Markdown
Member Author

PR Review Summary

Code Review: PASS

No critical or important issues found. Code is clean, well-structured, and follows project conventions.

Error Handling Review: Issues Found

HIGH Severity (3 issues)

Issue Location Description
Silent Server Startup main.py:81-92 start_standalone_server doesn't verify server actually started; timeout returns URL anyway
Thread Exception Swallowing main.py:64-78 _run_server exceptions silently kill thread with no error surfaced
Chat Loop Exception Handling main.py:262-263 Chat loop swallows ALL exceptions and continues

MEDIUM Severity (4 issues)

Issue Location Description
Broad Exception Catch main.py:171-173 ask command catches all exceptions without differentiation
Serve Command main.py:373-399 No exception handling for port conflicts etc.
Config Loading config.py:55-61 Silent fallback to defaults on config corruption
User ID Generation config.py:116-117 Silent user ID regeneration on corruption

Recommendation

For this release: The CLI is functional and these issues don't block shipping. They affect error messaging, not core functionality.

Follow-up: Create an issue to improve error handling in a future PR:

  • Add server startup verification
  • Make exception handling more specific
  • Track consecutive errors in chat loop

- Fix client to use assistant-specific endpoints (e.g., /hed/chat)
- Fix BYOK header names to match server expectations
- Disable API auth for standalone mode (local CLI use)
BYOK Policy: If user provides their own LLM API key (via X-OpenAI-API-Key,
X-Anthropic-API-Key, or X-OpenRouter-API-Key headers), they don't need a
server API key. This allows researchers to use the service with their own
keys without requiring server authentication.

- Modified verify_api_key to check for BYOK headers before requiring API key
- Added test for BYOK bypass behavior
- Updated error message to mention BYOK option
- Add BYOK documentation to DEPLOYMENT_ARCHITECTURE.md
- Add production URLs (osa, osa-dev) and Apache reverse proxy config
- Add CLI usage section with all commands
- Update README with deployment quick start
- Bump version to 0.2.0.dev1 for TestPyPI testing
- Fix version test to use dynamic version
- Add TestAssistantSubcommands class with tests for new CLI structure
- Test bare 'osa' shows assistants table
- Test 'osa hed --help' shows ask/chat commands
- Test unavailable assistants (bids, eeglab) reject commands
- Add BYOK bypass tests for all providers (OpenAI, Anthropic, OpenRouter)
- Fix integration tests: update endpoint /chat -> /hed/chat
- Fix integration tests: update header X-OpenRouter-Key -> X-OpenRouter-API-Key
- Fix integration tests: update CLI command structure
- Support both OPENROUTER_API_KEY and OPENROUTER_API_KEY_FOR_TESTING
@neuromechanist

Copy link
Copy Markdown
Member Author

PR Review Summary

Issues Addressed in Latest Commits

Test Coverage (Critical)

  • Added TestAssistantSubcommands class with tests for new CLI structure
  • Added BYOK bypass tests for all providers (OpenAI, Anthropic, OpenRouter)
  • Fixed integration tests: updated endpoint /chat → /hed/chat
  • Fixed integration tests: updated header X-OpenRouter-Key → X-OpenRouter-API-Key
  • Fixed CLI command structure in tests

Documentation

  • Added BYOK documentation to DEPLOYMENT_ARCHITECTURE.md
  • Added production URLs and Apache reverse proxy config
  • Updated README with deployment quick start

Remaining Issues to Consider

Important (from error handling review):

  1. src/cli/main.py:100 - Server startup timeout not validated (returns URL even if server fails to start)
  2. src/cli/main.py:180-182, 271-272 - Broad exception handling catches bare Exception
  3. src/cli/config.py:55-61 - Silent config load failure returns defaults without warning

These are valid concerns but can be addressed in a follow-up PR to avoid scope creep.

Test Results

  • 395 unit tests passing
  • Integration tests updated for CLI restructure
  • Version: 0.2.0.dev1 (published to TestPyPI)

Verified Working

  • CLI standalone mode with BYOK ✅
  • CLI with remote server (api.osc.earth/osa-dev) ✅
  • TestPyPI package installation ✅

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