# agent2: Use inline enums in \`now\` and \`edit_file\` tools JSON schema \(\#37397\) · gitcafe/zed

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

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

Visibility: public

Requested revision: d677c98f437c920fd954d166b0d7dd01b7b489d2

Requested commit: d677c98f437c920fd954d166b0d7dd01b7b489d2

Commit: d677c98f437c920fd954d166b0d7dd01b7b489d2

Tree: c0e86ff1f3eb766fd8ed4af4cf6e620fd0ee27e8

Author: Francis

Committer: GitHub

## Message

```
agent2: Use inline enums in `now` and `edit_file` tools JSON schema (#37397)

Added schemars annotations to generate inline enums instead of
references ($ref) in the JSON schema passed to LLMs.

Concerns :
- "timezeone" parameter for "now" tool function
- "mode" parameter for "edit_file" tool function

Should be the same for futures tools/functions enums. This is easier for
LLMs to understand the schema since many of them don't use JSON
references correctly.

Tested with :
- local GPT-OSS-120b with llama.cpp server (openai compatible)
- remote Claude Sonnet 4.0 with Zed pro subscription

Thanks in advance for the merge.
(notice this is my first PR ever on Github, I hope I'm doing things
well, please let me know if you have any comment - edit: just noticed my
username/email were not correctly setup on my local git, sorry, it's
been 5 years I've not used git)

Closes #37389

Release Notes:

- agent: Improve "now" and "edit_file" tool schemas to work with more
models.
```

## Parents

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

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