Skip to content

Adding managed agent changes - #48509

Open
Jayesh Tanna (jayesh-tanna) wants to merge 1 commit into
feature/azure-ai-projects/vnextfrom
jatanna/mha-v3
Open

Adding managed agent changes#48509
Jayesh Tanna (jayesh-tanna) wants to merge 1 commit into
feature/azure-ai-projects/vnextfrom
jatanna/mha-v3

Conversation

@jayesh-tanna

Copy link
Copy Markdown
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
9 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

Copy link
Copy Markdown
Contributor
[Pilot] PR Pipeline Failure Analysis

A CI pipeline failed on this pull request. Here is an automated analysis of what went wrong and how to get the build green.

What failed

Three checks failed for the azure-ai-projects package (Azure Pipelines build 6678788):

  1. Validation – Spelling (CSpell): Three unknown words (Qhwar, Jcbhix, urknn) were found in sdk/ai/azure-ai-projects/samples/managed_agents/sample_agent.py (lines 215–216). These appear to be random/placeholder strings in sample code.

  2. Validation – MyPy (type checking): 10 errors in 4 files — the patch files (_patch_agents.py, _patch_evaluation_rules.py, and their async counterparts) define method overloads that are incompatible with their base-class signatures (e.g. create_version and create_or_update override signatures don't cover all base-class overloads, and argument types like MutableMapping[str, Any] | IO[bytes] are passed where IO[bytes] is expected). Also, _patch_memories.py has a __init__ call mismatch.

  3. Validation – Pyright (type checking): 14 errors in the same set of patch files, essentially the same incompatible override and argument-type issues as MyPy, plus two reportOptionalMemberAccess errors in samples/managed_agents/sample_agent.py:287.

  4. Validation – API.md Consistency (GitHub Actions run): The committed api.md and api.metadata.yml for azure-ai-projects don't match what would be generated from the current source (e.g. parameter types changed from JSON to typed models like UpdateMemoryStoreRequest). The apiMdSha256 field in api.metadata.yml is out of date.

Recommended next steps

  • Fix the sample file spelling: Remove or replace the placeholder strings (Qhwar, Jcbhix, urknn) at samples/managed_agents/sample_agent.py:215–216. If these are intentional (e.g., test values), add them to the CSpell allowlist in .vscode/cspell.json.
  • Fix overload incompatibilities in patch files: Ensure the overload signatures in _patch_agents.py, _patch_evaluation_rules.py, and their aio counterparts cover all overloads defined in the generated base class. The subclass overloads must not add a MutableMapping[str, Any] variant if the base class doesn't have one, or the internal call must narrow the union type before passing it to the base method.
  • Fix _patch_memories.py __init__ call: The call at line 342 (sync) and 377 (async) passes Literal[0] to __init__ in a way that matches no overload.
  • Fix the optional attribute access in the sample: samples/managed_agents/sample_agent.py:287 accesses .code and .message on a value that may be None; add a None guard.
  • Regenerate api.md and api.metadata.yml: From sdk/ai/azure-ai-projects, run:
    azpysdk apistub .
    
    Then commit the updated api.md and api.metadata.yml.
  • See the CI troubleshooting guide: https://aka.ms/ci-fix
  • Push new commits to address the failures; this comment updates automatically on the next failing run.
Raw pipeline analysis (azsdk ci analyze)
Build: 6678788 Project: public
PipelineUrl: https://dev.azure.com/azure-sdk/public/_build/results?buildId=6678788

=== CSpell errors ===
sdk/ai/azure-ai-projects/samples/managed_agents/sample_agent.py:215:77 - Unknown word (Qhwar)
sdk/ai/azure-ai-projects/samples/managed_agents/sample_agent.py:216:71 - Unknown word (Jcbhix)
sdk/ai/azure-ai-projects/samples/managed_agents/sample_agent.py:216:79 - Unknown word (urknn)

=== MyPy errors (10 errors in 4 files) ===
_patch_evaluation_rules.py:35: error: Signature of "create_or_update" incompatible with supertype [override]
_patch_evaluation_rules.py:120: error: Argument 2 ... incompatible type ... [arg-type]
_patch_agents.py:54: error: Signature of "create_version" incompatible with supertype [override]
_patch_agents.py:215: error: Not all union combinations were tried [misc]
_patch_agents.py:217: error: Argument 2 ... incompatible type ... [arg-type]
_patch_evaluation_rules_async.py:35/119: same override/arg-type errors (async)
_patch_agents_async.py:36/196/198: same override/arg-type errors (async)
_patch_memories.py:377 / _patch_memories_async.py:342: No overloads for "__init__" match (Literal[0])

=== Pyright errors (14 errors) ===
_patch_agents_async.py:138,196,198: incompatible override / no overloads / arg type
_patch_evaluation_rules_async.py:119: no overloads / arg type
_patch_memories_async.py:342: no overloads for __init__
_patch_agents.py:156,215,217: same issues (sync)
_patch_evaluation_rules.py:120: same issues (sync)
samples/managed_agents/sample_agent.py:287: "code"/"message" not known attribute of "None"

=== API.md Consistency ===
api.md and api.metadata.yml (apiMdSha256) out of date for azure-ai-projects.
Fix: run `azpysdk apistub .` from sdk/ai/azure-ai-projects and commit results.

=== Failing checks ===
consistency [FAILURE]: https://github.com/Azure/azure-sdk-for-python/actions/runs/31360976847/job/93369655534
python - pullrequest [FAILURE]: https://dev.azure.com/azure-sdk/29ec6040-b234-4e31-b139-33dc4287b756/_build/results?buildId=6678788
python - pullrequest (Build Analyze) [FAILURE]: https://dev.azure.com/azure-sdk/29ec6040-b234-4e31-b139-33dc4287b756/_build/results?buildId=6678788&view=logs&jobId=b70e5e73-bbb6-5567-0939-8415943fadb9

Copilot detected the failing pipeline and generated the analysis above. To have it attempt a fix automatically, reply with `@copilot please fix the failing pipeline on this PR`.

Generated by Pipeline Analysis - Next Steps · 38.2 AIC · ⌖ 6.68 AIC · ⊞ 6.6K ·

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant