feat(python): add Devin AI sample agent with A365 SDK integration#316
Open
Yogeshp-MSFT wants to merge 3 commits into
Open
feat(python): add Devin AI sample agent with A365 SDK integration#316Yogeshp-MSFT wants to merge 3 commits into
Yogeshp-MSFT wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Python “Devin Sample Agent” that hosts an Agent 365-compatible aiohttp service integrating the Devin AI SDK, with notifications support and optional Agent 365 observability.
Changes:
- Introduces a runnable aiohttp server (
main.py) that wires up Agent 365 hosting, auth, notifications, health endpoint, and observability context. - Implements a Devin client wrapper (
client.py) and a minimal agent implementation (agent.py) that forwards user messages / email notifications to Devin. - Adds project/tooling scaffolding (pyproject, env template, Teams/Agents Playground YAML, tooling manifest, docs, gitignore).
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 15 comments.
Show a summary per file
| File | Description |
|---|---|
| python/devin/sample-agent/pyproject.toml | Defines packaging + dependencies for the sample agent project |
| python/devin/sample-agent/main.py | Server entry point: hosting, middleware, handlers, health, observability |
| python/devin/sample-agent/client.py | Devin SDK wrapper + polling + inference-scope telemetry |
| python/devin/sample-agent/agent.py | Agent implementation that delegates to Devin client |
| python/devin/sample-agent/README.md | End-to-end usage docs: local dev, Playground, deployment, troubleshooting |
| python/devin/sample-agent/.env.template | Environment variable template for running locally or in production |
| python/devin/sample-agent/.gitignore | Ignores local state, env files, build artifacts |
| python/devin/sample-agent/m365agents.yml | Agents Toolkit config stub |
| python/devin/sample-agent/m365agents.playground.yml | Playground deployment actions + env file creation |
| python/devin/sample-agent/ToolingManifest.json | Declares MCP server tool metadata |
Author
|
Hi @biswapm can you review this ? |
8d5e40c to
c3b7c7a
Compare
- client.py: key Devin session state by Agent 365 conversation.id so multi-user / multi-turn flows do not leak context between users - client.py: persist seen_event_ids per session so follow-up turns return only the new reply instead of the full history - client.py: parse POLLING_INTERVAL_SECONDS defensively; fall back to the default with a warning on invalid input - client.py: add comment explaining 'devinai' (PyPI) vs 'devin_sdk' (import) - agent.py: return a generic error message instead of exposing the raw exception text; document why auth / auth_handler_name are accepted but not used for the Devin SDK - main.py: same generic-error-message change in the message and notification handlers - .env.template: default AUTH_HANDLER_NAME to empty to match the comment and README guidance for Agents Playground / local dev
- client.py: replace unbounded session dict with an OrderedDict-based LRU cache (default 1000, override with DEVIN_MAX_SESSIONS). Long-running processes that handle many distinct conversations no longer leak memory. - client.py: drop the per-conversation session state once the Devin session reaches a terminal status so finished conversations stop consuming cache space. - client.py: use uuid.uuid4() instead of a millisecond timestamp for the fallback conversation_id so concurrent requests can't collide and accidentally share session state. - pyproject.toml: drop spaces around version operators in dependency specifiers (PEP 508 canonical form). - m365agents.playground.yml: write AUTH_HANDLER_NAME (the variable the server actually reads) instead of USE_AGENTIC_AUTH, and document what the two valid values mean for Playground / production.
Author
|
Hi @biswapm @microsoft/agent365-approvers please review this pr? |
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
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.
Summary
Adds a Python sample agent that integrates Devin AI with the Microsoft Agent 365 (A365) SDK. This sample is the Python equivalent of the existing Node.js Devin sample and uses the official
devinaiPython SDK.Changes Included
New Sample
Added a new sample under:
Key Components
main.pyagent.pyclient.pyAsyncDevinSDK) for session management and message processingpyproject.toml.env.templateREADME.mdmanifest/ToolingManifest.json.vscode/env/m365agents.yml/m365agents.playground.ymla365.config.jsonFeatures Demonstrated
Architecture
The sample follows the same structure and conventions used by the existing Python samples in the repository.
Documentation
README.mdValidation Performed
Dependencies
devinai(official Devin Python SDK)microsoft-opentelemetrySample Structure