Skip to content

feat: Nano Claw Code provider (stream-json harness)#141

Merged
Zhang-Henry merged 4 commits intomainfrom
feat/nano-claw-code-provider
Apr 11, 2026
Merged

feat: Nano Claw Code provider (stream-json harness)#141
Zhang-Henry merged 4 commits intomainfrom
feat/nano-claw-code-provider

Conversation

@davidliuk
Copy link
Copy Markdown
Collaborator

Adds a nano chat provider that runs the nano-claw-code CLI in --output-format stream-json\ mode and maps NDJSON lines to existing \claude-response\ / \claude-complete\ WebSocket messages so the current chat UI works without a parallel renderer.

Server

  • New \server/nano-claw-code.js: spawn CLI with -p, --dangerously-skip-permissions, deterministic --session-file drclaw-nano-.json, and --resume\ on follow-up turns.
  • WebSocket
    ano-command, abort/status/active-sessions wiring, REST agent route \provider: nano, /api/cli/nano/status.
  • \NANO_CLAW_CODE_COMMAND, \NANO_CLAW_CODE_MODEL, \NANO_CLAW_CODE_STREAMING\ documented in .env.example.

UI

  • New provider in empty-state picker, model list \NANO_CLAW_CODE_MODELS, i18n (en/zh-CN).

Harness

  • The nested
    ano-claude-code/\ checkout in this workspace includes companion changes (--session-file, --resume\ with -p\ for json/stream-json,
    ano_session_file\ on result events). Those files live in a separate git repo; merge them into nano-claw-code (or install from a branch that contains them) for multi-turn persistence. Dr. Claw works with a single-shot nano install but will not resume conversations until the CLI supports the new flags.

drclaw Python CLI

  • \�gent-harness: map provider
    ano\ → websocket
    ano-command.

Made with Cursor

@bbsngg bbsngg force-pushed the feat/nano-claw-code-provider branch from 7d8a8b2 to bf4af03 Compare April 8, 2026 18:05
@bbsngg
Copy link
Copy Markdown
Contributor

bbsngg commented Apr 8, 2026

PR Review: Nano Claw Code Provider & System Consolidation

This PR introduces the Nano Claw Code provider and consolidates the system by removing legacy research pipeline components (~70k lines). The implementation is high-quality and significantly improves maintainability.

Key Findings:

  1. Nano Claw Code Provider: Clean implementation reusing WebSocket shapes.
    • Suggestion: Ensure sessionId sanitization in sessionFileBasename prevents directory traversal.
    • Suggestion: Consider adding a process exit handler to clean up any orphaned Nano child processes.
  2. CLI Authentication: Major architectural improvement with centralized management.
    • Suggestion: Add Linux support or manual instructions to the installer map to avoid a broken experience for Linux users.
  3. Integration & Consolidation: Correctly wired, but Nano should be added to PROVIDER_WATCH_PATHS for consistent session file management.

Note on Rebase:

I have successfully rebased this PR onto main and resolved conflicts in the chat UI components (ChatInterface.tsx, ChatMessagesPane.tsx, and ProviderSelectionEmptyState.tsx). The updated code has been force-pushed to the branch.

Status: Approve with minor suggestions.

@bbsngg
Copy link
Copy Markdown
Contributor

bbsngg commented Apr 8, 2026

@davidliuk

@davidliuk davidliuk force-pushed the feat/nano-claw-code-provider branch from 76b032f to 2c6f4ae Compare April 11, 2026 04:34
@davidliuk
Copy link
Copy Markdown
Collaborator Author

Rename: nano-claw-code → nano-claude-code

This push completes the full rename from nano-claw-code to nano-claude-code across both this repo and the upstream nano-claude-code project.

Changes in this commit

Server:

  • Renamed server/nano-claw-code.jsserver/nano-claude-code.js
  • Removed all legacy NANO_CLAW_CODE_* env var fallbacks in cli-auth, cliResolution, modelConstants, and load-env
  • Cleaned up .env.example (removed legacy env var comments)

Frontend:

  • Added NanoClaudeLogo component with rounded-rect PNG icon (public/icons/nanoclaude.png)
  • Registered nano provider logo in SessionProviderLogo.tsx
  • Removed legacy nano-claw-code-settings / nano-claw-code-model localStorage fallbacks in chatStorage and useChatProviderState

Shared:

  • Removed NANO_CLAW_CODE_MODEL fallback in modelConstants.js
  • Updated nanoSessionPaths.js comment and brainstorm doc references

Bug fixed

  • nano-claude-code showing as "not installed": The .env still had NANO_CLAW_CODE_COMMAND pointing to the old CLI binary path. Updated to NANO_CLAUDE_CODE_COMMAND with the correct path.

Upstream (nano-claude-code repo)

Pushed rename commit to OpenLAIR/nano-claude-code main — Python package, imports, configs, tests, docs, and assets all renamed.

Comment thread server/routes/agent.js Fixed
@davidliuk davidliuk force-pushed the feat/nano-claw-code-provider branch from 2c6f4ae to 329d3bd Compare April 11, 2026 04:53
@Zhang-Henry
Copy link
Copy Markdown
Collaborator

Review follow-up — remaining items before merge

Current status: mergeStateStatus=UNSTABLE. Core provider review points (sessionId sanitization, orphan-process shutdown hooks, PROVIDER_WATCH_PATHS, Linux installer support) are all resolved. Two blockers remain:

🔴 CI build (20) fails — npm run typecheck

Branch is behind main; recent Sidebar / ChatInterface prop changes need to be merged in and wired through:

  • src/components/app/AppContent.tsx:230,263SidebarProps missing onOpenAutoResearch, onOpenCompute
  • src/components/chat/view/ChatInterface.tsx:106ChatInterfaceProps has no onOpenShellForSession
  • src/components/chat/view/ChatInterface.tsx:860ChatComposerProps missing setInput
  • src/components/chat/view/ChatInterface.tsx:946SidebarTab union now includes "shell", but the target type is still "context" | "research" | "files"

Suggested fix: git rebase origin/main, then forward the four new props and widen the SidebarTab handler.

🟡 Unused imports (code-quality bot)

server/routes/agent.js:18CLAUDE_MODELS and CURSOR_MODELS are imported but never referenced in the file. Please drop them from the named-import list.

Once typecheck is green and the unused imports are removed, this should be ready to merge.

Complete rename of all nano-claw-code references to nano-claude-code:

Server:
- Rename server/nano-claw-code.js to server/nano-claude-code.js
- Remove legacy NANO_CLAW_CODE_* env var fallbacks
- Update cli-auth.js: remove legacy command/env detection fallbacks
- Update .env.example: remove legacy env var comment

Frontend:
- Add NanoClaudeLogo component with rounded-rect PNG icon
- Register nano provider in SessionProviderLogo.tsx
- Update chatStorage: remove legacy nano-claw-code-settings fallback
- Update useChatProviderState: remove nano-claw-code-model fallback

Shared:
- Update modelConstants.js: remove NANO_CLAW_CODE_MODEL fallback
- Update nanoSessionPaths.js comment
- Update brainstorm doc file path references

Fixes: .env NANO_CLAW_CODE_COMMAND -> NANO_CLAUDE_CODE_COMMAND
Remove old-style SkillShortcutsPanel + ChatTaskProgressPill row that
was left over from a rebase conflict. Skill shortcuts are already
integrated into ChatComposer via SkillDropdown. Also removes the
unused ChatTaskProgressPill in the no-project-selected state and
cleans up dead imports (SkillShortcutsPanel, ChatTaskProgressPill,
useTasksSettings).
- Add onOpenAutoResearch and onOpenCompute handlers to sidebarSharedProps
  (fixes SidebarProps type mismatch in AppContent.tsx)
- Add onOpenShellForSession to ChatInterfaceProps
- Pass setInput prop to ChatComposer
- Widen sidebarTab state type to include 'shell' and 'git' tabs
- Remove duplicate SkillShortcutsPanel and stale ChatTaskProgressPill
- Remove unused imports: CLAUDE_MODELS, CURSOR_MODELS from agent.js;
  ChatTaskProgressPill, useTasksSettings from ChatInterface.tsx
- Fix remaining nano-claw-code references to nano-claude-code
@davidliuk davidliuk force-pushed the feat/nano-claw-code-provider branch from 329d3bd to 85f640b Compare April 11, 2026 05:04
@davidliuk
Copy link
Copy Markdown
Collaborator Author

Fixes applied — all review items resolved

Rebased onto latest origin/main and resolved all conflicts. npm run typecheck now passes cleanly.

🔴 CI typecheck fixes

Issue Fix
AppContent.tsx:230,263 — SidebarProps missing onOpenAutoResearch, onOpenCompute Added handleOpenAutoResearch and handleOpenCompute handlers in useProjectsState.ts, wired into sidebarSharedProps
ChatInterface.tsx:104ChatInterfaceProps has no onOpenShellForSession Added onOpenShellForSession?: () => void to ChatInterfaceProps in types.ts
ChatInterface.tsx:860ChatComposerProps missing setInput Passed setInput={setInput} prop to ChatComposer
ChatInterface.tsx:946 — SidebarTab union includes "shell"/"git" but state type narrower Widened sidebarTab state to 'context' | 'research' | 'files' | 'shell' | 'git'

🟡 Unused imports

Removed CLAUDE_MODELS and CURSOR_MODELS from the import in server/routes/agent.js.

Also cleaned up dead imports in ChatInterface.tsx: ChatTaskProgressPill, SkillShortcutsPanel, useTasksSettings.

Additional

  • Removed duplicate SkillShortcutsPanel + ChatTaskProgressPill row left over from rebase conflict (the new UI uses SkillDropdown inside ChatComposer)
  • Fixed two remaining nano-claw-codenano-claude-code string references in ChatInterface.tsx

@Zhang-Henry Zhang-Henry merged commit 422a329 into main Apr 11, 2026
3 checks passed
@Zhang-Henry Zhang-Henry deleted the feat/nano-claw-code-provider branch April 11, 2026 05:11
davidliuk added a commit that referenced this pull request Apr 11, 2026
The rebase in #141 (Nano Claude Code provider) incorrectly resolved
conflicts in the chat empty-state components, replacing the clean
Gemini-style greeting layout with the old verbose provider-selection
cards. This restores the pre-#141 UI for ProviderSelectionEmptyState,
ChatMessagesPane, and ChatInterface, then re-adds the minimal nano
provider wiring (types, availability, model config) needed for
compile compatibility. Nano Claude Code is commented out in the
composer provider list for now.

Made-with: Cursor
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.

3 participants