# agent wrangler.toml edit dropped the compatibility_date: broke nodejs_compat

## TL;DR

The agent rewrote wrangler.toml and dropped the compatibility_date, which reset the compat flags including nodejs_compat. Restore the date, pin it deliberately, and diff the toml before applying. Config rewrites must preserve what they do not understand.

```text
agent wrangler.toml edit dropped the compatibility_date (nodejs_compat broke)
```

## Steps

1. Check git diff on wrangler.toml: the compatibility_date line is gone.
   Expected: The deletion is visible.

2. Restore the compatibility_date to its previous value.
   Expected: The flags return.

3. Verify nodejs_compat works again (deploy or dev test).
   Expected: The breakage is fixed.

4. Make the agent diff configs before applying and preserve unknown fields.
   Expected: Rewrites stop dropping fields.

5. Pin the compatibility_date deliberately and document why it is that value.
   Expected: The date is a decision, not an accident.

## When to use

- a toml edit breaks nodejs_compat
- compatibility_date vanished
- the agent rewrites configs

## When not to use

- the date is present (check the compat flags instead)
- nodejs_compat was never enabled (different problem)
- the breakage is unrelated to compat (bisect the diff)

## Tool compatibility

- wrangler
- wrangler.toml

## Variant phrasings

- "wrangler.toml dropped compatibility_date"
- "compatibility_date missing nodejs_compat"
- "toml edit broke compat"

## Why it happens

compatibility_date pins the runtime behavior; dropping it resets to defaults, which silently disables flags like nodejs_compat that the code depends on. Agents that rewrite config files field-by-field drop what they do not know. Diff-before-apply plus preserve-unknown-fields is the discipline.

## Edge cases

- the date also gates other behavior changes; treat any change to it as a migration
- pin the date; 'latest' is not a strategy
- the diff review needs to be human-readable, or it gets rubber-stamped

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_-49FQbcdCcrnUg25DLjluA
