-
Notifications
You must be signed in to change notification settings - Fork 125
apps MCP: restructure context management #4073
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
Merged
Merged
Conversation
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
Collaborator
|
Commit: 5ca293e
22 interesting tests: 13 flaky, 7 KNOWN, 2 SKIP
Top 28 slowest tests (at least 2 minutes):
|
igrekun
reviewed
Dec 3, 2025
keugenek
reviewed
Dec 3, 2025
| | **L2: Target** | Target-specific: validation, deployment, constraints | When target type detected or after `init-template` | | ||
| | **L3: Template** | SDK/language-specific: file structure, commands, patterns | After `init-template`. For existing projects, agent reads CLAUDE.md. | | ||
|
|
||
| L0 is implicit - tool descriptions guide agent behavior before any tool is called (e.g., `databricks_discover` description tells agent to call it first during planning). |
Contributor
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.
lets make the comment there for Claude and Cursor not to modify
keugenek
reviewed
Dec 3, 2025
|
|
||
| | Layer | Content | When Injected | | ||
| |-------|---------|---------------| | ||
| | **L0: Tools** | Tool names and descriptions | Always (MCP protocol) | |
Contributor
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.
not clear - if L0 are our MCP tools or not
keugenek
approved these changes
Dec 3, 2025
igrekun
approved these changes
Dec 3, 2025
Collaborator
|
Commit: 6ab1806
15 interesting tests: 7 KNOWN, 4 flaky, 3 RECOVERED, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
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.
Changes
Restructure the MCP context management into three layers to establish separation of concerns.
Prompts are not changed here, subject for a separate change.
Why
Why separate context layers?
The previous implementation mixed different types of guidance in a single template — app-specific validation rules sat alongside TypeScript SDK patterns, making it hard to support new target types (jobs, pipelines) or new templates (Python apps). By separating into L0 (tool descriptions), L1 (universal workflow), L2 (target-specific), and L3 (template-specific), each layer can evolve independently. Adding a new target type now means creating one target_.tmpl file rather than modifying shared templates.
Why replace first-call middleware with explicit databricks_discover?
The middleware approach injected context into whatever tool happened to run first — fragile and non-recoverable if the agent missed it. The explicit databricks_discover tool lets agents request context when they need it, re-call it when switching directories, and get project-aware guidance (detecting apps/jobs from databricks.yml). The tool description itself serves as L0 context, instructing agents to call it first during planning without any middleware magic.