Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions temporalio/nexus/_operation_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,15 +776,15 @@ def _apply_nexus_context_to_start_activity_request( # pyright: ignore[reportUnu
req.on_conflict_options.attach_completion_callbacks = True
req.on_conflict_options.attach_links = True

# Add request_id and all Nexus links if we're in a Nexus context, backing or otherwise
req.request_id = nexus_ctx.nexus_context.request_id
# Add all Nexus links if we're in a Nexus context, backing or otherwise
request_links = nexus_ctx._get_request_links()

# Links are duplicated on request for compatibility with older server versions.
req.links.extend(request_links)

if _in_nexus_backing_start_context():
# Add callbacks only if we're in a backing Nexus context
# Add request_id and callbacks only if we're in a backing Nexus context
req.request_id = nexus_ctx.nexus_context.request_id
callbacks = nexus_ctx._get_callbacks(
OperationToken(
type=OperationTokenType.ACTIVITY,
Expand Down
2 changes: 1 addition & 1 deletion tests/nexus/test_link_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ async def test_activity_start_forwards_inbound_links() -> None:

assert len(req.links) == 1
assert req.links[0] == _inbound_nexus_link()
assert req.request_id == "req-id"
assert not req.request_id
assert len(req.completion_callbacks) == 0


Expand Down
Loading