-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: native agent-teams & optional MCB integration #1726
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
Draft
marlon-costa-dc
wants to merge
18
commits into
code-yeongyu:dev
Choose a base branch
from
marlon-costa-dc:feat/native-agent-teams-mcb-integration
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 8 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a50db34
feat(agent-teams): port native agent teams orchestration from KNN7
marlon-costa-dc b187e7f
feat(mcb): add resilient MCB integration adapter with graceful fallback
marlon-costa-dc c640d08
feat(artifacts): add legacy artifact detection and MCB ingestion pipe…
marlon-costa-dc 1f69b47
feat(compat): add legacy context migration shims
marlon-costa-dc f4d7b3f
fix: guard against non-object JSON parse and ensure cleanup resilience
marlon-costa-dc 9c1471c
feat(mcb): make MCB integration config-gated and disabled by default
marlon-costa-dc b3bb56b
docs: add MCB integration configuration and tuning guide
marlon-costa-dc e7fe7a9
refactor(agent-teams): split oversized files and remove unused MCB fa…
marlon-costa-dc 1bc1825
feat(mcb): add queued fallback sync and degradation warnings
marlon-costa-dc e952064
feat(mcb): wire MCB as builtin skill with stdio transport and recover…
marlon-costa-dc 5c4e4f6
fix(agent-teams): root-anchor .gitignore mcb pattern and resume teamm…
marlon-costa-dc 24a90eb
test(mcb): add real-binary E2E coverage for stdio MCP integration
marlon-costa-dc 2cad930
test(mcb): add write-read roundtrip E2E coverage
marlon-costa-dc 2146418
Merge remote-tracking branch 'upstream/dev' into feat/native-agent-te…
marlon-costa-dc 69c2e89
test(mcb): add real SQLite DB verification with local-only config
marlon-costa-dc 48e7be4
test(mcb): strengthen memory store assertions with content/type/proje…
marlon-costa-dc 7a7617b
test(mcb): fix tier2 assertions for new MCB 0.2.1 behavior and add se…
marlon-costa-dc 76c78d1
test(mcb): align defaults and validate assertions with 0.2.1-dev beha…
marlon-costa-dc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,3 +35,8 @@ test-injection/ | |
| notepad.md | ||
| oauth-success.html | ||
| *.bun-build | ||
|
|
||
| # Runtime data | ||
| .arbor/ | ||
| .oc-state/ | ||
| mcb.* | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,257 @@ | ||
| # MCB Integration Guide | ||
|
|
||
| Memory Context Bank (MCB) integration for oh-my-opencode. Provides semantic code search, persistent memory, code validation, and version control awareness across sessions. | ||
|
|
||
| **MCB is completely optional.** Oh-my-opencode works perfectly without it. When disabled (the default), MCB has zero impact on the plugin. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - An MCB server running and accessible via HTTP | ||
| - oh-my-opencode v3.4.0+ | ||
|
|
||
| ## Quick Start | ||
|
|
||
| Add to your `.opencode/oh-my-opencode.json` (project-level) or `~/.config/opencode/oh-my-opencode.json` (user-level): | ||
|
|
||
| ```jsonc | ||
| { | ||
| "mcb": { | ||
| "enabled": true, | ||
| "url": "http://localhost:3100" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| That's it. All MCB tools are enabled by default when `enabled` is `true`. | ||
|
|
||
| ## Configuration Reference | ||
|
|
||
| All fields are optional. MCB is disabled unless `enabled` is explicitly set to `true`. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "mcb": { | ||
| // Master switch. Must be true to activate MCB integration. | ||
| // Default: undefined (treated as disabled) | ||
| "enabled": true, | ||
|
|
||
| // MCB server URL. Must be a valid URL. | ||
| "url": "http://localhost:3100", | ||
|
|
||
| // Default collection for search and indexing operations. | ||
| "default_collection": "my-project", | ||
|
|
||
| // Automatically index the project on plugin startup. | ||
| "auto_index": false, | ||
|
|
||
| // Per-tool toggles. Each defaults to true when MCB is enabled. | ||
| "tools": { | ||
| "search": true, // Semantic code search across indexed repositories | ||
| "memory": true, // Persistent observations, error patterns, quality gates | ||
| "index": true, // Codebase indexing for semantic search | ||
| "validate": true, // Code quality validation (12 built-in rules) | ||
| "vcs": true, // Git-aware context (branch comparison, impact analysis) | ||
| "session": true // Session lifecycle tracking | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Field Details | ||
|
|
||
| | Field | Type | Default | Description | | ||
| |-------|------|---------|-------------| | ||
| | `enabled` | `boolean` | `undefined` | Master switch. MCB is inactive unless explicitly `true`. | | ||
| | `url` | `string` (URL) | - | MCB server endpoint. Required when `enabled` is `true`. | | ||
| | `default_collection` | `string` | - | Default collection name for search/index operations. | | ||
| | `auto_index` | `boolean` | - | Auto-index project codebase on plugin startup. | | ||
| | `tools.search` | `boolean` | `true` | Enable semantic code search (`mcb_search`). | | ||
| | `tools.memory` | `boolean` | `true` | Enable persistent memory (`mcb_memory`). | | ||
| | `tools.index` | `boolean` | `true` | Enable codebase indexing (`mcb_index`). | | ||
| | `tools.validate` | `boolean` | `true` | Enable code validation (`mcb_validate`). | | ||
| | `tools.vcs` | `boolean` | `true` | Enable git-aware context (`mcb_vcs`). | | ||
| | `tools.session` | `boolean` | `true` | Enable session tracking (`mcb_session`). | | ||
|
|
||
| ## Recommended Configurations | ||
|
|
||
| ### Minimal (Search + Memory) | ||
|
|
||
| Best for: individual developers who want semantic search and cross-session memory without the overhead of full integration. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "mcb": { | ||
| "enabled": true, | ||
| "url": "http://localhost:3100", | ||
| "tools": { | ||
| "search": true, | ||
| "memory": true, | ||
| "index": false, | ||
| "validate": false, | ||
| "vcs": false, | ||
| "session": false | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Development (Search + Memory + Index + Validate) | ||
|
|
||
| Best for: active development workflows where you want code quality checks and automatic indexing alongside search. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "mcb": { | ||
| "enabled": true, | ||
| "url": "http://localhost:3100", | ||
| "auto_index": true, | ||
| "tools": { | ||
| "search": true, | ||
| "memory": true, | ||
| "index": true, | ||
| "validate": true, | ||
| "vcs": false, | ||
| "session": false | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Full (All Tools) | ||
|
|
||
| Best for: teams or power users who want the complete MCB experience including git-aware context and session tracking. | ||
|
|
||
| ```jsonc | ||
| { | ||
| "mcb": { | ||
| "enabled": true, | ||
| "url": "http://localhost:3100", | ||
| "default_collection": "my-project", | ||
| "auto_index": true, | ||
| "tools": { | ||
| "search": true, | ||
| "memory": true, | ||
| "index": true, | ||
| "validate": true, | ||
| "vcs": true, | ||
| "session": true | ||
| } | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ## How It Works | ||
|
|
||
| ### Config Gate | ||
|
|
||
| When oh-my-opencode starts, it reads the `mcb` config and makes a one-time decision: | ||
|
|
||
| 1. **`enabled` is falsy or missing**: MCB is permanently disabled for the session. All MCB tool calls return gracefully with no-op results. Zero overhead. | ||
| 2. **`enabled` is `true`**: Per-tool toggles are evaluated. Disabled tools are marked unavailable. The availability state is then **locked** for the rest of the session. | ||
|
|
||
| This lock-on-startup design means: | ||
| - No runtime configuration drift | ||
| - No unexpected MCB calls mid-session | ||
| - Deterministic behavior from the moment the plugin loads | ||
|
|
||
| ### Graceful Degradation | ||
|
|
||
| Every MCB operation is wrapped in a fallback layer. If an MCB call fails at runtime (server unreachable, timeout, unexpected error): | ||
|
|
||
| - The operation returns a degraded result instead of throwing | ||
| - The specific tool that failed is automatically marked unavailable for subsequent calls | ||
| - The rest of oh-my-opencode continues working normally | ||
|
|
||
| This means a flaky MCB server will never crash your session. At worst, you lose MCB features for that session while everything else keeps working. | ||
|
|
||
| ## MCB Tools Reference | ||
|
|
||
| ### `mcb_search` (search) | ||
|
|
||
| Semantic search across indexed code, memory observations, and context. | ||
|
|
||
| | Resource | Description | | ||
| |----------|-------------| | ||
| | `code` | Search indexed source code semantically | | ||
| | `memory` | Search stored observations and patterns | | ||
| | `context` | Search project context and metadata | | ||
|
|
||
| ### `mcb_memory` (memory) | ||
|
|
||
| Store and retrieve persistent observations across sessions. | ||
|
|
||
| | Resource Type | Description | | ||
| |---------------|-------------| | ||
| | `observation` | General observations about codebase | | ||
| | `execution` | Execution logs and outcomes | | ||
| | `quality_gate` | Quality check results | | ||
| | `error_pattern` | Recurring error patterns | | ||
| | `session` | Session-level context | | ||
|
|
||
| ### `mcb_index` (index) | ||
|
|
||
| Index project source code for semantic search. | ||
|
|
||
| | Action | Description | | ||
| |--------|-------------| | ||
| | `start` | Begin indexing a directory | | ||
| | `status` | Check indexing progress | | ||
| | `clear` | Remove indexed data | | ||
|
|
||
| ### `mcb_validate` (validate) | ||
|
|
||
| Run code quality validation with 12 built-in rules. | ||
|
|
||
| | Action | Description | | ||
| |--------|-------------| | ||
| | `run` | Validate a file or project | | ||
| | `list_rules` | Show available validation rules | | ||
| | `analyze` | Deep analysis with complexity metrics | | ||
|
|
||
| ### `mcb_vcs` (vcs) | ||
|
|
||
| Git-aware context and impact analysis. | ||
|
|
||
| Provides repository listing, branch comparison, and change impact analysis. | ||
|
|
||
| ### `mcb_session` (session) | ||
|
|
||
| Session lifecycle management for tracking work across conversations. | ||
|
|
||
| ## Tuning Tips | ||
|
|
||
| 1. **Start minimal.** Enable only `search` and `memory` first. Add tools as you find value in them. | ||
|
|
||
| 2. **Use `auto_index` for active projects.** If you're working on the same codebase daily, auto-indexing on startup ensures search results stay fresh. | ||
|
|
||
| 3. **Disable `session` if you don't need cross-session tracking.** Session tracking adds overhead and is most useful for teams tracking work across multiple developers. | ||
|
|
||
| 4. **Use `default_collection` to namespace projects.** If you work on multiple projects against the same MCB server, set a unique collection name per project config. | ||
|
|
||
| 5. **Disable `validate` if you have existing linters.** MCB validation is useful when you don't have ESLint/Biome configured, but redundant if you already have a lint pipeline. | ||
|
|
||
| 6. **Keep `vcs` disabled unless you need cross-branch analysis.** The built-in git tools in oh-my-opencode handle most git operations. MCB VCS adds value when comparing branches or analyzing change impact across large codebases. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### MCB tools not appearing | ||
|
|
||
| - Verify `"enabled": true` is set in your config | ||
| - Check that your config file is in the correct location (`.opencode/oh-my-opencode.json` or `~/.config/opencode/oh-my-opencode.json`) | ||
| - Restart your opencode session (MCB config is evaluated once at startup) | ||
|
|
||
| ### MCB calls returning degraded results | ||
|
|
||
| - Check that your MCB server is running and accessible at the configured `url` | ||
| - Verify network connectivity: `curl http://localhost:3100/health` | ||
| - If a tool was auto-disabled due to errors, restart the session to re-enable it | ||
|
|
||
| ### Config changes not taking effect | ||
|
|
||
| MCB availability is locked at startup. Any config changes require restarting the opencode session to take effect. This is by design to ensure consistent behavior within a session. | ||
|
|
||
| ### Specific tools not working | ||
|
|
||
| - Check the `tools` section in your config — individual tools can be disabled | ||
| - Some tools have known limitations (see AGENTS.md for current MCB tool status) | ||
| - Ensure the MCB server version supports the tool you're trying to use |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import { z } from "zod" | ||
|
|
||
| export const McbConfigSchema = z.object({ | ||
| enabled: z.boolean().optional(), | ||
| url: z.string().url().optional(), | ||
| default_collection: z.string().optional(), | ||
| auto_index: z.boolean().optional(), | ||
| tools: z | ||
| .object({ | ||
| search: z.boolean().optional(), | ||
| memory: z.boolean().optional(), | ||
| index: z.boolean().optional(), | ||
| validate: z.boolean().optional(), | ||
| vcs: z.boolean().optional(), | ||
| session: z.boolean().optional(), | ||
| }) | ||
| .optional(), | ||
| }) | ||
|
|
||
| export type McbConfig = z.infer<typeof McbConfigSchema> |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| export { scanArtifacts } from "./scanner" | ||
| export type { ScanOptions } from "./scanner" | ||
| export { ingestArtifacts } from "./ingestion" | ||
| export type { IngestionResult } from "./ingestion" | ||
| export type { | ||
| ArtifactClass, | ||
| DetectedArtifact, | ||
| ArtifactScanResult, | ||
| IngestionRecord, | ||
| } from "./types" |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.