Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[FEATURE]: Test that PermissionV2 declines pending requests when its scope closes

Open Beginner friendly
#51,220 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
88/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
testing-qa

Research direction

Start in packages/core/test/permission.test.ts and compare the V1 test, pending permission rejects on instance dispose, in packages/opencode/test/permission/next.test.ts. Build the PermissionV2 layer in its own Layer.fresh scope, create a pending request, then close the scope. Done means the waiting assert fails with DeclinedError and list() returns empty.

Written by the indexing model from the issue text.

Description

Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

PermissionV2 registers a finalizer (packages/core/src/permission.ts, the addFinalizer near the top of the layer) that fails every pending request with DeclinedError and clears the map when the scope closes. Nothing in packages/core/test/permission.test.ts exercises it. The V1 equivalent has a test (pending permission rejects on instance dispose in packages/opencode/test/permission/next.test.ts), so a shutdown that leaked waiters would currently go unnoticed in V2.

I checked the behaviour is correct today. This is only a coverage gap, not a bug: with a request pending, closing the scope makes the waiting assert die with DeclinedError and list() returns empty.

I'd like to add one test for this. It needs the layer built in its own scope with Layer.fresh, since the shared test layer would otherwise hold the finalizer. Happy to send the PR if that's fine.

Dominant language
TypeScript
Stars
210k
Forks
27.8k
Avg merge
8h 43m
Merged PRs (30d)
380

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.