Azure / Azure/azure-sdk-for-java
[BUG] Incorrect API path in listRunStepsSync returns run data instead of steps (regression from commit 0f8c354)
- Dominant language
- Java
- Stars
- 2.6k
- Forks
- 2.2k
- Avg merge
- 2d 8h
- Merged PRs (30d)
- 178
Description
**Describe the bug**
The listRunStepsSync method uses an incorrect path (/threads/{threadId}/runs/{runId}) that returns run-level data instead of the expected steps list. This is a regression from the previously correct implementation in commit 0f8c354 which used /steps suffix. The bug causes:
- Silent failures (no exceptions)
- Wrong data returned (run object instead of steps)
- Breaks API contract without obvious errors
***Exception or Stack Trace***
Add the exception log and stack trace if available
**To Reproduce**
1. Create a thread and execute a run
2. Call listRunStepsSync(threadId, runId)
3. Observe:
- HTTP 200 response (misleading success)
- Response contains run object instead of steps array
- Missing expected step metadata
***Code Snippet***
Current incorrect implementation: [link error](https://github.com/Azure/azure-sdk-for-java/blob/f3af884f5430705d63a8496f209e29c5796632a1/sdk/ai/azure-ai-agents-persistent/src/main/java/com/azure/ai/agents/persistent/implementation/RunsImpl.java#L297)
```java
@Get("/threads/{threadId}/runs/{runId}") // Wrong path - missing /steps
Response listRunStepsSync(...)
```
Correct implementation (from commit [0f8c354](https://github.com/abdulrahman305/azure-sdk-for-java/commit/0f8c354e50f7eb4e4cb99561e76c9fc8b47f66ec)):
```java
@Get("/threads/{threadId}/runs/{runId}/steps") // Correct path
Response listRunStepsSync(...)
```
**Expected behavior**
Calling listRunStepsSync should:
1. Use the correct /steps endpoint
2. Return HTTP 200 with proper steps array
3. Include step objects with:
```json
{
"object": "list",
"data": [
{
"id": "step_123",
"object": "thread.run.step",
"type": "message_creation"
}
]
}
```
**Screenshots**
Example of expected response, with the path:
- https://aifoseu**************.services.ai.azure.com/api/projects/********/threads/thread_lvJF2jqxJKikT4eh3voAEZPJ/runs/run_L3LMxv1sy4BHLG9pZVSbsgDo/steps?api-version=2025-05-01
**Setup (please complete the following information):**
- OS: Windows 11
- IDE: IntelliJ IDEA 2023.3
- Library/Libraries: azure-ai-agent-persistent:1.0.0-beta.2
- Java version: 17
- App Server/Environment: Spring Boot 3.1.4
- Frameworks: Spring Web 6.0.11
**Additional context**
Critical impacts:
1. Silent Failure: No errors thrown despite wrong behavior
2. Regression: Worked correctly in commit 0f8c354
3. Documentation Mismatch: Contradicts official API specs
4. Debugging Difficulty: Requires response inspection to detect
**Information Checklist**
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report
- [x] Bug Description Added
- [x] Repro Steps Added
- [x] Setup information Added
Contributor guide
Assessment
This issue has not been assessed yet.