# debugger: Fix debug scenario's defined in debug.json not using passed in build task \(\#29973\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a0bfe4d293fc71964e0498ef22076daa411b405f)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a0bfe4d293fc71964e0498ef22076daa411b405f

Requested commit: a0bfe4d293fc71964e0498ef22076daa411b405f

Commit: a0bfe4d293fc71964e0498ef22076daa411b405f

Tree: 97970a546ada0a9dcd043dba6f14885fa38b2e81

Author: Anthony Eid

Committer: GitHub

## Message

```
debugger: Fix debug scenario's defined in debug.json not using passed in build task (#29973)

There were two bugs that caused user-defined debug scenarios from being
able to run a build task.

1. DebugRequest would be deserialized to `Attach` even when `process_id`
wasn't defined in a user's configuration file. This has been fixed by
adding our own deserializer that defaults to None if there are no fields
present instead of `Attach`, and I added tests to prevent regressions.
2. Debug scenario resolve phase never got the active buffer when
spawning a debug session from the new session modal. This has been
worked around by passing in the worktree_id of a debug scenario in the
scenario picker and the active worktree_id otherwise.

Release Notes:

- N/A
```

## Parents

- [52ea501f4f4488ec8fb9cbc5e6203b69c1ce5b9e](https://git.cafe/gitcafe/zed/commit/52ea501f4f4488ec8fb9cbc5e6203b69c1ce5b9e?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a0bfe4d293fc71964e0498ef22076daa411b405f?format=markdown)
