Skip to content

Whitelist ConcurrentStack for concurrent collections#9949

Open
Copilot wants to merge 2 commits intomasterfrom
copilot/whitelist-concurrentstack-issue
Open

Whitelist ConcurrentStack for concurrent collections#9949
Copilot wants to merge 2 commits intomasterfrom
copilot/whitelist-concurrentstack-issue

Conversation

Copy link

Copilot AI commented Feb 2, 2026

System.Collections.Concurrent.ConcurrentStack<T> was blocked by the whitelist despite other concurrent collections being available, preventing users from using stack-based thread-safe data structures.

Changes

  • Added ConcurrentStack* to BaseAccess.cs alongside ConcurrentBag, ConcurrentDictionary, and BlockingCollection

This enables standard concurrent stack operations in sandboxed code:

var stack = new ConcurrentStack<int>();
stack.Push(42);
stack.TryPop(out var result);
var count = stack.Count;
Original prompt

This section details on the original issue you should resolve

<issue_title>[Whitelist] System.Collections.Concurrent.ConcurrentStack<></issue_title>
<issue_description>### What it is?
```Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack1' is not allowed when whitelist is enabled 10:06:44 Compiler [SB1000](https://sbox.game/dev/doc/code/code-basics/api-whitelist/) 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack1' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1..ctor()' is not allowed when whitelist is enabled
10:06:44 Compiler SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.Push( T )' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.Push( T )' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.TryPop( T& )' is not allowed when whitelist is enabled
10:06:44 Compiler SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.TryPop( T& )' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.TryPop( T& )' is not allowed when whitelist is enabled
10:06:44 Compiler [1] SB1000 'System.Collections.Concurrent/System.Collections.Concurrent.ConcurrentStack`1.get_Count()' is not allowed when whitelist is enabled


### Why do you need to use this?

Sometimes we need ConcurrentStack for threading</issue_description>

<agent_instructions>Add to Sandbox.Access whitelist</agent_instructions>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: handsomematt <1388267+handsomematt@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix whitelist issue for ConcurrentStack type Whitelist ConcurrentStack for concurrent collections Feb 2, 2026
Copilot AI requested a review from handsomematt February 2, 2026 09:30
@handsomematt handsomematt marked this pull request as ready for review February 2, 2026 09:33
Copilot AI review requested due to automatic review settings February 2, 2026 09:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds ConcurrentStack<T> to the API whitelist for sandboxed code, enabling users to utilize thread-safe stack operations alongside the already-whitelisted concurrent collections (ConcurrentBag, ConcurrentDictionary, and BlockingCollection).

Changes:

  • Added ConcurrentStack* wildcard pattern to the BaseAccess whitelist

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@handsomematt handsomematt added the triaged triaged pull-requests are replicated on the internal sbox repo label Feb 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triaged triaged pull-requests are replicated on the internal sbox repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Whitelist] System.Collections.Concurrent.ConcurrentStack<>

2 participants