-
Notifications
You must be signed in to change notification settings - Fork 0
release: v1.7.0 #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: v1.7.0 #63
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,53 @@ | ||
| # Changelog | ||
|
|
||
| ## v1.7.0 (2026-04-14) | ||
|
|
||
| ### Memory System v2 (Claude Code inspired) | ||
| - **Memory categories**: project, user, feedback, reference — organized facts | ||
| - **Self-skeptical prompt**: "Treat memory as hints — verify against actual code" | ||
| - **Dream cleanup**: `memory.compact()` deduplicates, keeps newest | ||
| - **Auto-compact on start**: runs when >150 facts accumulated | ||
| - **Auto-categorized detection**: 15+ patterns auto-classify facts | ||
| - **Critical fix**: MemoryStore was never initialized — all memory features were dead | ||
|
|
||
| ### System Prompt Hardening | ||
| - **All 30 tools described** (was 12/30) in 5 categories | ||
| - **Security section**: prompt injection detection, no untrusted execution | ||
| - **What NOT to Do**: 7 negative rules (no write for small edits, no guess, etc.) | ||
| - **Cost Awareness**: prefer cheap operations, edit over write | ||
| - **Section reorder**: important rules at end for max model attention | ||
|
|
||
| ### Security & Quality CI | ||
| - **cargo-audit**: dependency vulnerability scanning on every PR | ||
| - **cargo-deny**: license compliance (allowlist), supply chain checks | ||
| - **dependency-review**: block PRs adding high-severity vulns or GPL deps | ||
| - **Strict clippy**: correctness + suspicious as errors | ||
| - **Dependabot alerts**: enabled | ||
|
|
||
| ### New Features | ||
| - **Browser automation**: headless Playwright (navigate, screenshot, click, type, eval JS) | ||
| - **Debug mode**: hypothesis-driven structured debugging (4 phases) | ||
| - **GitHub integration**: `/gh prs`, `/gh issues`, `/gh status`, `/gh checks` | ||
| - **Agent profiles**: `/profile save/load/list` | ||
| - **Context pinning**: `/pin` — pinned messages survive compaction | ||
| - **Auto-skill creation**: auto-generate skills after complex tasks | ||
| - **Cross-session FTS search**: `/search-all` across all saved sessions | ||
| - **Configurable notifications**: `notifications` toggle + webhook (Slack/Discord) | ||
|
|
||
| ### UX Improvements | ||
| - **Animated spinner** during streaming/tool execution | ||
| - **Bell notification** when agent finishes | ||
| - **Categorized /help** (Navigation, Session, Agent, Code, Tools, Workflow, Config) | ||
| - **Quit confirmation** for unsaved sessions | ||
| - **Ctrl+R** reverse history search | ||
|
|
||
| ### Infrastructure | ||
| - **tree-sitter** AST symbol extraction (Rust, Python, JS/TS, Go) | ||
| - **arboard** cross-platform clipboard (replaces shell pbcopy/xclip) | ||
| - **GitHub templates**: bug report, feature request, PR template | ||
| - **SECURITY.md**: vulnerability reporting policy | ||
| - **274 tests**, 50% coverage, 0 warnings | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ## v1.6.0 (2026-04-12) | ||
|
|
||
| ### Managed Agents & Agentic AI | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,66 @@ | ||||||
| # Getting Started | ||||||
|
|
||||||
| ## Install | ||||||
|
|
||||||
| ### Quick install (Linux/macOS) | ||||||
| ```bash | ||||||
| curl -fsSL https://raw.githubusercontent.com/kienbui1995/mc-code/main/install.sh | sh | ||||||
| ``` | ||||||
|
|
||||||
| ### Build from source | ||||||
| ```bash | ||||||
| git clone https://github.com/kienbui1995/mc-code.git | ||||||
| cd mc-code/mc | ||||||
| cargo install --path crates/mc-cli | ||||||
| ``` | ||||||
|
|
||||||
| ## Setup | ||||||
|
|
||||||
| Set your API key: | ||||||
| ```bash | ||||||
| export ANTHROPIC_API_KEY="your-key" | ||||||
| # or: OPENAI_API_KEY, GEMINI_API_KEY, GROQ_API_KEY, etc. | ||||||
| ``` | ||||||
|
|
||||||
| ## First run | ||||||
|
|
||||||
| ```bash | ||||||
| magic-code # interactive TUI | ||||||
| magic-code "fix the bug in auth.rs" # single-shot mode | ||||||
| echo "explain this" | magic-code --pipe # pipe mode | ||||||
| ``` | ||||||
|
|
||||||
| ## Key concepts | ||||||
|
|
||||||
| - **Tools**: Agent has 30 built-in tools (bash, file ops, search, browser, debug, etc.) | ||||||
| - **Memory**: Persistent project facts across sessions (`/memory`) | ||||||
| - **Skills**: Reusable coding patterns (`.magic-code/skills/*.md`) | ||||||
| - **Agents**: Named agent configs (`agents/*.md`) | ||||||
| - **Sessions**: Save/load/branch conversations | ||||||
|
|
||||||
| ## Essential commands | ||||||
|
|
||||||
| | Command | Description | | ||||||
| |---------|-------------| | ||||||
| | `/help` | Show all commands (categorized) | | ||||||
| | `/model` | Switch LLM model | | ||||||
| | `/plan` | Toggle plan mode (think before acting) | | ||||||
| | `/save` | Save current session | | ||||||
| | `/undo` | Undo last file changes | | ||||||
| | `/cost` | Show session cost | | ||||||
| | `/compact` | Compress context when running low | | ||||||
| | `/debug` | Enter structured debugging mode | | ||||||
| | `/gh` | GitHub integration | | ||||||
|
|
||||||
| ## Configuration | ||||||
|
|
||||||
| Create `.magic-code/config.toml` in your project: | ||||||
| ```toml | ||||||
| [default] | ||||||
| model = "claude-sonnet-4-20250514" | ||||||
| max_tokens = 8192 | ||||||
| provider = "anthropic" | ||||||
| notifications = true | ||||||
| ``` | ||||||
|
|
||||||
| See [Configuration Reference](reference/config.md) for all options. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the relative link path to the config reference. Line 66 currently links to Proposed fix-See [Configuration Reference](reference/config.md) for all options.
+See [Configuration Reference](../reference/config.md) for all options.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # Memory System | ||
|
|
||
| magic-code has a 3-layer memory system inspired by Claude Code's architecture. | ||
|
|
||
| ## Layer 1: Semantic Memory (Project Facts) | ||
|
|
||
| Persistent key-value facts organized in 4 categories: | ||
|
|
||
| | Category | What it stores | Example | | ||
| |----------|---------------|---------| | ||
| | **project** | Architecture, tools, conventions | `test_cmd = "cargo test"` | | ||
| | **user** | Preferences, role, style | `coding_style = "prefer functional"` | | ||
| | **feedback** | Corrections from user | `"always use snake_case"` | | ||
| | **reference** | File locations, endpoints | `api_endpoint = "localhost:8080"` | | ||
|
|
||
| ### Usage | ||
| ``` | ||
| /memory # list all facts | ||
| /memory get test_cmd # get specific fact | ||
| /memory set test_cmd "pytest" # save fact | ||
| /memory delete old_key # remove fact | ||
| ``` | ||
|
|
||
|
Comment on lines
+17
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add language identifiers to plain fenced code blocks. Several fenced blocks (Lines 17, 51, 59, 72, 84) omit language tags, which will keep triggering lint warnings. Suggested update pattern-```
+```text
/memory # list all facts
...Verify each finding against the current code and only fix it if needed. In |
||
| Agent can also use `memory_write` tool with category: | ||
| ```json | ||
| {"key": "db", "value": "PostgreSQL 15", "category": "project"} | ||
| ``` | ||
|
|
||
| ### Auto-memory | ||
| Agent automatically saves facts detected in its output: | ||
| - "project uses..." → project category | ||
| - "convention is..." → feedback category | ||
| - "running on port..." → reference category | ||
| - "user prefers..." → user category | ||
|
|
||
| ### Self-skeptical | ||
| Memory is injected into the system prompt with a warning: | ||
| > *Treat as hints — verify against actual code before acting.* | ||
|
|
||
| This prevents hallucination from stale memory. | ||
|
|
||
| ### Dream cleanup | ||
| When memory exceeds 150 facts, auto-compact runs on session start: | ||
| - Deduplicates by key (keeps newest) | ||
| - Removes stale entries | ||
|
|
||
| ## Layer 2: Episodic Memory (Session History) | ||
|
|
||
| Past conversations saved as JSON files. | ||
|
|
||
| ``` | ||
| ~/.local/share/magic-code/sessions/ | ||
| ├── last.json # auto-saved | ||
| ├── my-feature.json # /save my-feature | ||
| └── debug-auth.json # /save debug-auth | ||
| ``` | ||
|
|
||
| ### Commands | ||
| ``` | ||
| /save <name> # save session | ||
| /load <name> # resume session | ||
| /sessions # list saved sessions | ||
| /search-all <query> # FTS across all sessions | ||
| /fork # branch current session | ||
| /branches # list branches | ||
| ``` | ||
|
|
||
| ## Layer 3: Procedural Memory (Skills) | ||
|
|
||
| Reusable coding patterns stored as markdown files. | ||
|
|
||
| ``` | ||
| .magic-code/skills/ | ||
| ├── setup-nextjs.md # user-created | ||
| ├── deploy-aws.md # user-created | ||
| └── auto/ | ||
| └── auto-3t-8-1713000000.md # auto-generated | ||
| ``` | ||
|
|
||
| ### Auto-skill creation | ||
| After complex successful turns (≥6 tool calls, no errors), agent auto-generates a skill file. Next time it encounters a similar task, it loads the skill. | ||
|
|
||
| ### Named agents | ||
| ``` | ||
| agents/ | ||
| ├── reviewer.md # code review specialist | ||
| └── architect.md # system design specialist | ||
| ``` | ||
|
|
||
| Each agent has its own model, tools, and instructions defined in YAML frontmatter. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Configuration Reference | ||
|
|
||
| ## Config file locations (priority order) | ||
| 1. `.magic-code/config.toml` (project — highest) | ||
| 2. `~/.config/magic-code/config.toml` (user) | ||
| 3. Built-in defaults (lowest) | ||
|
|
||
| ## All options | ||
|
|
||
| ```toml | ||
| [default] | ||
| # LLM | ||
| model = "claude-sonnet-4-20250514" | ||
| max_tokens = 8192 | ||
| provider = "anthropic" | ||
| base_url = "" # custom API endpoint | ||
| fallback_provider = "" # secondary provider | ||
| fallback_model = "" # secondary model | ||
|
|
||
| # Permissions | ||
| permission_mode = "auto" # auto | allow | deny | prompt | ||
|
|
||
| # Context | ||
| compaction_threshold = 0.8 # compact at 80% context usage | ||
| compaction_preserve_recent = 4 # keep last 4 messages | ||
|
|
||
| # Notifications | ||
| notifications = true # bell + desktop notifications | ||
| notification_webhook = "" # Slack/Discord webhook URL | ||
|
|
||
|
Comment on lines
+11
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Lines 16–30 include fields that are not loaded from Proposed docs correction [default]
# LLM
model = "claude-sonnet-4-20250514"
max_tokens = 8192
provider = "anthropic"
-base_url = "" # custom API endpoint
-fallback_provider = "" # secondary provider
-fallback_model = "" # secondary model
# Permissions
permission_mode = "auto" # auto | allow | deny | prompt
-
-# Context
-compaction_threshold = 0.8 # compact at 80% context usage
-compaction_preserve_recent = 4 # keep last 4 messages
-
-# Notifications
-notifications = true # bell + desktop notifications
-notification_webhook = "" # Slack/Discord webhook URL
+
+[compaction]
+auto_compact_threshold = 0.8
+preserve_recent_messages = 4Also add a short note that fallback provider/model and notifications are runtime defaults unless explicitly supported by current config schema. 🤖 Prompt for AI Agents |
||
| # Managed Agents | ||
| [managed_agents] | ||
| enabled = false | ||
| executor_model = "claude-haiku-3-5-20241022" | ||
| executor_max_turns = 5 | ||
| max_concurrent = 3 | ||
| budget_usd = 1.0 | ||
| ``` | ||
|
|
||
| ## Environment variables | ||
|
|
||
| | Variable | Description | | ||
| |----------|-------------| | ||
| | `ANTHROPIC_API_KEY` | Anthropic API key | | ||
| | `OPENAI_API_KEY` | OpenAI API key | | ||
| | `GEMINI_API_KEY` | Google Gemini API key | | ||
| | `GROQ_API_KEY` | Groq API key | | ||
| | `DEEPSEEK_API_KEY` | DeepSeek API key | | ||
| | `OPENROUTER_API_KEY` | OpenRouter API key | | ||
| | `XAI_API_KEY` | xAI (Grok) API key | | ||
|
|
||
| ## CLI flags | ||
|
|
||
| ``` | ||
| --model <MODEL> LLM model | ||
| --provider <PROVIDER> Provider name | ||
| --max-tokens <N> Max tokens per response | ||
| --resume Resume last session | ||
| --session-id <ID> Resume specific session | ||
| --pipe Read from stdin | ||
| --json JSON output mode | ||
| --yes Auto-approve (CI/CD) | ||
| --trace Debug logging | ||
| --validate-config Validate and exit | ||
| --max-budget-usd <N> Cost limit | ||
| --max-turns <N> Turn limit | ||
| --add-dir <DIR> Grant access to extra directories | ||
| ``` | ||
|
Comment on lines
+54
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a language identifier to the fenced CLI block. Line 54 starts a fenced code block without language, which triggers markdown lint warnings. Proposed fix-```
+```text
--model <MODEL> LLM model
--provider <PROVIDER> Provider name
...
--add-dir <DIR> Grant access to extra directories🧰 Tools🪛 markdownlint-cli2 (0.22.0)[warning] 54-54: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog states that
/search-allsearches across "all saved sessions," but the implementation inmc-core/src/fts.rs(line 41) limits the search to the 100 most recent sessions and stops after finding 20 results (line 93). This discrepancy should be clarified in the documentation or the implementation should be updated to match the description.