microsoft / microsoft/teams.py
[Bug]: ctx.stream.close() returns placeholder activity ID
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 65
- Forks
- 30
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 23
Description
### Bug Description
`await ctx.stream.close()` returns a `SentActivity` whose `id` is
`DO_NOT_USE_PLACEHOLDER_ID` instead of the ID of the streamed activity.
Teams returns the stream/activity ID from the initial streaming request. Later streaming requests, including the final request, return an empty successful response. The SDK currently maps the empty response to its placeholder ID and returns that value from `HttpStream.close()`, even though the stream has stored the actual ID from the initial request.
### Steps to Reproduce
1. Emit content through `ctx.stream.emit()`.
2. Await the activity with `ctx.stream.close()`.
3. Observe that `result.id` is `DO_NOT_USE_PLACEHOLDER_ID`.
### Expected Behavior
`ctx.stream.close()` should return a `SentActivity` with the original stream ID, or at least not the `DO_NOT_USE_PLACEHOLDER_ID` value.
### Actual Behavior
`ctx.stream.close()` returns a `SentActivity` set to `DO_NOT_USE_PLACEHOLDER_ID`.
### SDK Version
v2.0.0a31
### Python Version
3.12.10
### Additional Context
_No response_
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the HttpStream.close() entry point and trace how the stored stream ID and the empty final response are mapped into the returned SentActivity. Reproduce the issue with ctx.stream.emit() followed by ctx.stream.close(), then verify that the result uses the original stream ID rather than DO_NOT_USE_PLACEHOLDER_ID.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100