Skip to content

Add Agent Skills for App supervisor api + background mode#183

Open
jennsun wants to merge 3 commits intodatabricks:mainfrom
jennsun:agent-supervisorapi-backgroundmode
Open

Add Agent Skills for App supervisor api + background mode#183
jennsun wants to merge 3 commits intodatabricks:mainfrom
jennsun:agent-supervisorapi-backgroundmode

Conversation

@jennsun
Copy link
Copy Markdown
Contributor

@jennsun jennsun commented Apr 9, 2026

use supervisor api + background mode skills

background-mode-template.mp4

with mcp tool call approval + mocked streaming

mcp-server-mocked-streaming.online-video-cutter.com.mp4

@jennsun jennsun changed the title Agent supervisorapi backgroundmode SKILLS Add Agent Skills for App supervisor api + background mode Apr 10, 2026
@jennsun jennsun marked this pull request as ready for review April 10, 2026 23:48
### 2. Simulated streaming for the frontend

The chat frontend expects SSE streaming events. Since background mode currently returns the full text at once, `output_item_to_stream_events()` chunks text into 3-word deltas to simulate a streaming experience. Streaming will be supported soon to fix this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: update this once sabhya's changes to support streaming are in

f"[poll] Skipping incomplete item: "
f"type={item_dict.get('type')}, status={item_status}"
)
continue
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a break right? If we have some incomplete in the middle, we dont want to stream the ones after if they are complete because then it will be out of order

Comment thread .claude/skills/supervisor-api-background-mode/SKILL.md Outdated
Comment thread .claude/skills/supervisor-api-background-mode/SKILL.md Outdated
Comment thread .claude/skills/supervisor-api-background-mode/SKILL.md Outdated
```python
TOOLS = [
# Genie space — natural language queries over structured data
{
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we change these? We renamed stuff to this tool spec: https://openapi.dev.databricks.com/pr-1737623/api/workspace/supervisoragents/createtool

@jennsun jennsun force-pushed the agent-supervisorapi-backgroundmode branch 3 times, most recently from cc5b14b to 78251a3 Compare April 14, 2026 03:39
Add two new skills for using the Databricks Supervisor API:
- supervisor-api: base skill for hosted tools (Genie, UC functions, KA endpoints, MCP servers)
- supervisor-api-background-mode: long-running tasks with polling and simulated streaming

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jennsun jennsun force-pushed the agent-supervisorapi-backgroundmode branch from 78251a3 to 52d3ca4 Compare April 14, 2026 03:44
jennsun and others added 2 commits April 15, 2026 08:32
- Change chunk size from 3 words to 1 word for smoother streaming
- Add 30ms delay between stream event yields for visible streaming effect
- Add asyncio import to agent.py
- Add quickstart as prerequisite (sets up MLflow experiment + .env)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jennsun jennsun requested a review from aravind-segu April 15, 2026 15:38
Copy link
Copy Markdown
Contributor

@dhruv0811 dhruv0811 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall!

Would be great if we could add some external references to these skills to improve discoverability. Having skills which are used by customers to now tell customers about new offerings might be a cool way of marketing this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems the sync-skills.py file wasn't updated with the new skill?

return None


def create_supervisor_client(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come we don't forward OBO token x-forwarded-access-token with background mode? Is this not supported yet? I see we are doing this in the other regular supervisor-api skill with _get_client()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it might be useful to reference these skills in the base AGENTS.md to improve discovery, perhaps we can also mention there what supervisor API is, and when the agent should suggest it to the user? This would help enable customer discovery of this new offering as well

Comment on lines +349 to +350
workspace_client = WorkspaceClient()
client = create_supervisor_client(workspace_client)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is there a reason we don't cache these at a module level? We do this for the base supervisor-api skill. Constructing a new WorkspaceClient and AsyncDatabricksOpenAI might be a little inefficient?

ResponsesAgentResponse,
)

mlflow.openai.autolog()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed a couple spots where we hardcode openai like this. Is it worth having a separate langchain example??

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