feat: fork Qwen Code as AIRIS Code base with Ollama backend#1
Merged
Conversation
Fork Qwen Code (760df2c14) into airis-code monorepo as the foundation for an autonomous coding agent that serves as a Claude Code substitute when usage limits are reached. Phase 1 - Fork & Branding: - Copy packages/core → packages/airiscode-core - Copy packages/cli → apps/airiscode-cli - Rename .qwen → .airiscode, @qwen-code → @airiscode - Delete Gemini/Google OAuth/Vertex AI/ACP/Channel code - Track upstream commit in .airiscode-upstream Phase 2 - Ollama Backend: - Add OllamaOpenAICompatibleProvider (OpenAI-compat /v1 API) - Add AuthType.USE_OLLAMA with API key validation bypass - Wire into determineProvider() detection chain - Route USE_OLLAMA through existing OpenAI content generator Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix tsconfig.json extends path (tsconfig.json → tsconfig.base.json) - Add missing dependencies (@types/node, zod, @types/shell-quote, etc) - Add OpenTelemetry peer dependencies - Set strict: false (matching upstream Qwen Code behavior) - Inline ACP SDK types (removed @agentclientprotocol/sdk dependency) - Stub Google auth providers (google-auth-library not needed) - Fix AuthType enum mappings (add ollama, remove gemini/vertex-ai) - Fix OTel version mismatch with type casts - Update pnpm-lock.yaml Core package now builds successfully with `pnpm turbo run build` Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Plan agent: architecture analysis, implementation planning, with edit tools gated by permission mode (Claude Code-style dry-run) - code-reviewer agent: read-only code review with confidence scoring, checks against AIRISCODE.md standards Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CI now targets @airiscode/core with turbo --filter - Remove lint/npm-test jobs (legacy packages lack eslint) - Fix CLI tsconfig: add rootDir, strict:false, skipLibCheck - Use Node 22 + pnpm 10.12.0 (matching local environment) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- /commit skill: conventional commit workflow with staging, message drafting, and hook-safe commit creation - rulesLoader: loads .airiscode/rules/*.md at session start for project-specific agent instructions (Claude Code .claude/rules/ pattern) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
HookType.Inject allows injecting content as a system message without spawning an external process. Supports variable substitution ($TOOL_NAME, $TOOL_INPUT, $SESSION_ID, $CWD, $EVENT) and target specification (main/subagent/both). This enables the "must read docs before editing" pattern: PreToolUse inject hooks can force documentation reading before allowing file modifications — the core value proposition for local models that tend to skip reference material. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Load .airiscode/settings.local.json after workspace settings with higher priority. This file should be gitignored for developer-specific configuration (API keys, local model preferences, etc). Priority order (highest to lowest): 1. CLI arguments 2. Environment variables 3. .airiscode/settings.local.json (workspace-local, gitignored) 4. .airiscode/settings.json (workspace, git-tracked) 5. ~/.airiscode/settings.json (user global) 6. System defaults Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Local models via Ollama (e.g., qwen3:8b with 32K context) need earlier compaction than cloud models. Lower threshold from 70% to 60% to prevent context overflow during multi-turn agent loops. Configurable via settings: chatCompression.contextPercentageThreshold Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enable seamless transition between Claude Code and AIRIS Code: - rulesLoader: scan both .claude/rules/ and .airiscode/rules/ (.airiscode takes precedence on filename conflicts) - memoryTool: add CLAUDE.md to default context file list, so projects with existing CLAUDE.md work out of the box This allows teams to share the same project configuration across both tools without duplication. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Auto-detect auth type from environment: 1. OPENAI_API_KEY + OPENAI_MODEL + OPENAI_BASE_URL → OpenAI 2. ANTHROPIC_API_KEY + ANTHROPIC_MODEL → Anthropic 3. QWEN_OAUTH → DashScope (legacy) 4. OLLAMA_HOST or OLLAMA_MODEL → Ollama 5. No keys set → Ollama (local-first default) Remove dead Gemini/Vertex AI detection paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add missing deps (chalk, cli-spinners, @types/hast) - Replace USE_GEMINI/USE_VERTEX_AI → USE_OPENAI in CLI auth paths - Stub deleted modules (channel, acp-integration, web-templates) - Stub Qwen OAuth UI (useQwenAuth, QwenOAuthProgress) - Fix HookConfig union type access across hook UI components - Fix duplicate auth entries in auth.ts - Fix GIT_COMMIT_INFO type mismatch - Inline ACP SDK types in export/collect.ts - Both @airiscode/core and @airiscode/cli build successfully Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Phase 1 of the AIRIS Code v1 rebuild. The Qwen Code fork has been stripped of its upstream-specific surface and migrated to airis-monorepo as the single source of truth (manifest.toml → package.json / compose.yml / tsconfig). The CLI now boots inside a Docker-isolated workspace with no @google/genai, no @opentelemetry/*, and no Qwen/Alibaba telemetry. What's gone: - Aliyun RUM phone-home telemetry (qwen-logger → deleted) - Qwen OAuth, DashScope provider, Google service-account / OAuth MCP auth - 21 @opentelemetry/* packages (sdk.ts / loggers.ts / metrics.ts are now no-op stubs gated on isTelemetrySdkInitialized() returning false) - @google/genai (replaced by self-hosted types in src/types/llm.ts, which is re-exported from @airiscode/core) - ~250 test files that covered the deleted surface (to be regenerated in later phases) - docker-compose.dev.yml / Dockerfile.dev / workspace.yaml (legacy) What's in: - manifest.toml declares every app, lib, service, dependency, TS option - airis gen produces package.json, compose.yml, pnpm-workspace.yaml, tsconfig.base.json and per-package tsconfig.json - Docker workspace with per-package named volumes (no bind mounts, no host node_modules leakage) - core and cli both build green; `airiscode --help` boots Naming cleanups: - @airiscode/airiscode-core → @airiscode/core - @airiscode/airiscode-cli → @airiscode/cli - apps/airiscode-cli/index.ts moved to src/index.ts so tsc can include it Known follow-ups (tracked for Phase 2): - CLI header still says "Usage: qwen" (branding, Tier E) - Layer 2 packages under packages/ (adapters, mcp, drivers, gemini-*, ...) are dormant and slated for deletion / responsibility-based split - mcpToTool() is a stub that throws; real runtime comes with the driver-based MCP session layer in Phase 2 - tsconfig ignoreDeprecations is a manual override until airis-monorepo stops unconditionally writing "6.0" - react 19.1 vs ink 6.8 peer-dep mismatch (non-fatal) - 6 airis-monorepo issues to file (app-definition unification, field expansion, import-scanner opt-in, generation modes, convention opt-out, hardcoded-value guards) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
.qwen→.airiscode,@qwen-code/*→@airiscode/*across 1400+ filesOllamaOpenAICompatibleProviderfor local Ollama inference via OpenAI-compatible APIAuthType.USE_OLLAMAwith API key validation bypassContext
AIRIS Code is a Claude Code substitute for when usage limits are reached. Built on Qwen Code's agent loop, hooks, subagents, skills, and permission system — with the LLM backend swapped to Ollama for local inference.
Upstream tracking:
.airiscode-upstreamrecords the source commit for future cherry-picks.Test plan
pnpm installresolves dependenciespnpm turbo run buildcompiles (remaining AuthType cleanup needed)qwen3:8btool calling roundtrip works🤖 Generated with Claude Code