Skip to content

experiment: cdf . agent plugin - #3083

Draft
ronpal wants to merge 1 commit into
mainfrom
experiment/cdf-agent-plugin
Draft

experiment: cdf . agent plugin#3083
ronpal wants to merge 1 commit into
mainfrom
experiment/cdf-agent-plugin

Conversation

@ronpal

@ronpal ronpal commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an experimental cdf . command (behind [plugins] agent = true) that sends natural-language prompts to the CDF Agents chat API
  • Implements a client-side tool harness (read/write files, grep, glob, run_cdf) with permission modes
  • Persists conversation context between invocations via .cdf/agent-session.json and the chat API cursor (--new to reset)

Test plan

  • Enable agent = true in cdf.toml plugins
  • cdf . list modules in this project
  • cdf . now add a transformation for assets — should resume prior context
  • cdf . --new start over — should start fresh
  • Unit tests: uv run pytest tests/test_unit/test_cdf_tk/test_commands/test_agent*.py tests/test_unit/test_cdf_tk/test_client/test_agents_chat.py

Do not merge — experimental prototype for review and iteration only.

Prototype plugin that runs natural-language prompts via CDF Agents chat API,
with client-side tools and cursor-based conversation continuity in .cdf/agent-session.json.
@ronpal ronpal added the do-no-merge PR that should not be merged. label Jun 26, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

@github-actions

Copy link
Copy Markdown

☂️ Code Coverage

current status: ✅

Overall Coverage

Statements Covered Coverage Threshold Status
44274 38020 86% 80% 🟢

New Files

File Coverage Status
cognite_toolkit/_cdf_tk/client/resource_classes/agent_chat.py 91% 🟢
cognite_toolkit/_cdf_tk/commands/agent.py 56% 🟢
cognite_toolkit/_cdf_tk/commands/agent_session.py 87% 🟢
TOTAL 78% 🟢

Modified Files

File Coverage Status
cognite_toolkit/_cdf_tk/client/api/agents.py 97% 🟢
cognite_toolkit/_cdf_tk/commands/init.py 100% 🟢
cognite_toolkit/_cdf_tk/plugins.py 90% 🟢
TOTAL 96% 🟢

updated for commit: 92d132b by action🐍

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.33045% with 142 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.87%. Comparing base (d0c6b7a) to head (92d132b).
⚠️ Report is 96 commits behind head on main.

Files with missing lines Patch % Lines
cognite_toolkit/_cdf_tk/commands/agent.py 55.94% 126 Missing ⚠️
...lkit/_cdf_tk/client/resource_classes/agent_chat.py 91.47% 11 Missing ⚠️
cognite_toolkit/_cdf_tk/commands/agent_session.py 86.66% 4 Missing ⚠️
cognite_toolkit/_cdf_tk/client/api/agents.py 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3083      +/-   ##
==========================================
- Coverage   86.04%   85.87%   -0.17%     
==========================================
  Files         475      478       +3     
  Lines       43812    44274     +462     
==========================================
+ Hits        37697    38020     +323     
- Misses       6115     6254     +139     
Files with missing lines Coverage Δ
cognite_toolkit/_cdf_tk/commands/__init__.py 100.00% <100.00%> (ø)
cognite_toolkit/_cdf_tk/plugins.py 90.00% <100.00%> (+0.52%) ⬆️
cognite_toolkit/_cdf_tk/client/api/agents.py 97.29% <93.75%> (-2.71%) ⬇️
cognite_toolkit/_cdf_tk/commands/agent_session.py 86.66% <86.66%> (ø)
...lkit/_cdf_tk/client/resource_classes/agent_chat.py 91.47% <91.47%> (ø)
cognite_toolkit/_cdf_tk/commands/agent.py 55.94% <55.94%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-no-merge PR that should not be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant