How do I review C# Montage client disposal around tool execution?
Asynchronous disposal can make a discovered C# tool unusable if the client closes before the call completes. Trace the installed SDK’s resource ownership directly, preserving authorization errors and cancellation uncertainty instead of repairing timing by sharing a user’s connection globally. Resource ownership should cover the whole asynchronous call rather than end after tool discovery. Correct disposal timing preserves both user association and honest errors without treating an interrupted response as proof that a remote operation was reversed.
Help me review C# Montage client disposal around tool execution. Locate transport creation, client initialization, tool discovery, execution and disposal. Record the returned workspace or exact lifecycle blocker and complete documented resource release. No writes.Map the active resource scope
Locate transport creation, client initialization, tool discovery, execution and disposal. Identify helpers returning tool references that still depend on a client whose owning scope has already ended.
Consult the installed lifecycle
Follow the official C# client documentation for asynchronous ownership and cleanup. Do not copy server-host shutdown code or a method signature from another package generation merely because the types have similar names.
Preserve user-scoped access
Keep approved Montage authorization attached to the intended caller while operations settle. An indefinitely shared client is not a safe replacement for correct ownership in an application serving multiple accounts.
Exercise the real call timing
Invoke signals_status directly before supported disposal completes and inspect the actual response. If execution is interrupted, retain that uncertainty rather than claiming cancellation rolled back remote work or that an empty result proves zero coverage.
Conclude after cleanup
Record the returned workspace or exact lifecycle blocker and complete documented resource release. Direct success requires no inference and validates only this execution path, not every later concurrent caller or future SDK version.
Keep the boundaries clear.
- An indefinitely shared client is not a safe replacement for correct ownership in an application serving multiple accounts.
- Direct success requires no inference and validates only this execution path, not every later concurrent caller or future SDK version.
Start with a read-only check: ask your agent to report actual source coverage before collecting records or exporting an audience.
Primary references
Documentation reviewed 2026-11-15. Product capabilities, client availability and plans can change. Third-party marks identify their products, not an affiliation.