Skip to content

agents: report unknown fields in agent manifests - #2093

Open
nveerdixit wants to merge 18 commits into
digitalocean:mainfrom
nveerdixit:marsohs-2583-unknown-fields
Open

nveerdixit wants to merge 18 commits into
digitalocean:mainfrom
nveerdixit:marsohs-2583-unknown-fields

Conversation

@nveerdixit

@nveerdixit nveerdixit commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What

doctl harness-runtime validate and create --dry-run accepted any top-level key in a flat agent manifest. A misspelled field such as egresss: or permisions: printed "Manifest looks valid", and --dry-run echoed the key back as if it were applied. The server rejects unknown keys, but only when the session is created.

doctl now checks field names locally, against an embedded copy of the manifest schema's key tree, one object at a time.

Behavior

Input Result
Unknown key within edit distance 2 of a known key in the same object, and the distance is less than the known key's length Error with a "did you mean" hint. Same rule as the server.
Any other unknown key Warning (exit 0). It may be a field newer than this doctl.
--strict Every manifest warning becomes an error.
--allow-unknown-fields The "did you mean" errors above become warnings, so a field newer than this doctl does not block the command. Other errors are unchanged. Cannot be combined with --strict or --from-config.
Keys inside open objects (config, labels, env, secret slot names, rule match, skill metadata, tool catalog keys) Not checked.
Keys inside egress Existing checks are unchanged.
Legacy apiVersion envelope manifests Unchanged.

The check runs in validate, create --dry-run, real create and launch (before any API call, including the GitHub auth offer), and through config create and trigger create. create --dry-run runs the same validation as a real create, after ${VAR} expansion, so it fails exactly where create would and then prints no manifest. With only warnings it prints them on stderr and still prints the manifest. --strict applies to every warning there too, including a credential in env.

Example:

$ doctl harness-runtime validate agents.yaml
✗ Manifest is invalid · 1 error

  Error  egresss
           unknown field "egresss" (did you mean "egress"? if this is a newer
           field, upgrade doctl)

Notes for reviewers

  • Behavior change: misspelled keys and legacy camelCase names (for example keepWarm) now fail locally in validate, create, config create and trigger create. The server already rejected them at create. create --dry-run now also fails on any error a real create would reject (for example an unknown adapter, or with --strict a credential in env), where it used to print the manifest.
  • Drift: the schema copy is embedded (commands/agent.flat.schema.json) and the key tree is built from it once, at first use, by one walker. A schema refresh is: replace the copy. There is no generated file to go stale. Building the tree costs about 0.6 ms once per process, only on commands that check a manifest; the binary grows by the 24 KB schema. The copy itself is still refreshed by hand; a drift check on the schema's side is tracked in MARSOHS-3157. The copy matches the published schema of 2026-11-19 key for key; system_prompt and secrets.<name>.actor, added since, are not in it yet and warn as newer fields. A sibling-pair test pins the only two keys that sit within edit distance 2 of each other in the same object today (mode/model, min/max).
  • Risk: a future server field spelled within two letters of an existing one (for example a singular or plural of a current field) is rejected by an older doctl. The error text says to upgrade, and --allow-unknown-fields lets the user continue without waiting for a release.
  • Schema copy: refreshed from cthulhu master 968f5d189ba6 on 2026-11-19. It adds policy_profile, which the server has accepted since MARSOHS-2158. Before, validate --strict failed on a valid manifest that used it.
  • Trigger --from-config: the unknown-field check is skipped, because that manifest is the server's stored copy and the user cannot edit its field names.
  • Flags with nothing to check: --strict and --allow-unknown-fields fail with a clear error before any API call when there is no manifest for them to check. That applies with --from-config, with triggers create --session-mode reuse, and with triggers update without --spec. An explicit --strict=false asks for nothing and passes. They still have no effect when launching an existing session.

Testing

  • gofmt -l, go vet ./commands/ clean.
  • go test ./commands/ passes except TestRegistryLogout, which also fails on unmodified main on a machine without a native keychain entry.
  • New unit tests cover the near-miss rule, tie-breaks, case handling, open objects, nested and array paths, non-string YAML keys, --strict on every command that has it, dry-run and real-create ordering, exactly-once warnings, and a golden file proving valid manifests print the same output as before.
  • Built the binary and ran validate / create --dry-run against a typo, a nested typo, an unknown key and a valid manifest, and create --dry-run --strict against a credential in env (fails, prints nothing).
  • The tree built from the embedded schema is identical, key for key and in order, to the generated tree it replaced.

🤖 Generated with Claude Code

@nveerdixit
nveerdixit marked this pull request as ready for review November 2, 2026 09:02
@nveerdixit
nveerdixit force-pushed the marsohs-2583-unknown-fields branch 3 times, most recently from b61e511 to d07e437 Compare November 2, 2026 09:18
`validate` and `create --dry-run` accepted any top-level key, so a
misspelled field such as `egresss:` or `permisions:` looked valid and was
echoed back as if it were applied. The server rejected it only when the
session was created.

doctl now checks flat-manifest field names against an embedded copy of the
schema's key tree, per object:

- a key within edit distance 2 of a known key in the same object (and
  shorter than that key) is an error with a "did you mean" hint, using the
  same rule as the server;
- any other unknown key is a warning, since it may be a newer server field;
- open objects (config, labels, env, secrets slots, rule match, skill
  metadata, tool catalog keys) are not checked, and the existing egress
  checks keep their own errors.

The check also runs on `create --dry-run` and on real `create` / `launch`,
before any API call, and through config and trigger create. A new
`--strict` flag turns every manifest warning into an error. A test compares
the embedded key tree to a copy of the schema so drift fails CI.

Refs MARSOHS-2583

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nveerdixit
nveerdixit force-pushed the marsohs-2583-unknown-fields branch from d07e437 to 3ed6251 Compare November 4, 2026 10:46

@vrindavinod-do vrindavinod-do left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review

I cloned this branch and ran the code. The quality is good. I have one request before approval.

What I verified

  • The code builds. gofmt -l and go vet ./commands/ report no problems.
  • All tests in ./commands/ pass. Only TestRegistryLogout fails. It fails because the test machine has no keychain entry. This failure is not related to this change. The statement in the description is correct.
  • TestManifestKeyTreeMatchesSchemaCopy is complete and strong. It walks the schema, resolves $ref pointers, follows oneOf, anyOf and allOf branches, and compares the keys of each closed object in order.
  • The code reports an unknown field one time only. create and launch use the early check, then use validateAgentManifestSkippingUnknownKeys. config create, trigger create and validate each run the check one time.
  • The early check runs before each API call and before each side effect.
  • The edge cases are correct. I tested non-string keys (5: x), ${VAR} keys, empty keys, root-level lists, legacy apiVersion envelopes, and tool catalog entries. All of them behave correctly.

This change cannot break the server. It is a client-side check. It can only stop work on a user machine or in a user pipeline.

Problem 1: A user cannot continue after a false positive (most important)

The near-miss rule makes an error, not a warning. The --strict flag only makes the rule more strict. There is no flag to make the rule less strict.

I wrote a probe to find which new field names cause an error. Singular and plural pairs are the risk:

ERROR  (root)      "tool"     -> suggests "tools"
ERROR  (root)      "secret"   -> suggests "secrets"
ERROR  (root)      "repo"     -> suggests "repos"
ERROR  (root)      "label"    -> suggests "labels"
ERROR  (root)      "mount"    -> suggests "mounts"
ERROR  permissions "rule"     -> suggests "rules"
ERROR  model       "defaults" -> suggests "default"
ERROR  mounts[]    "paths"    -> suggests "path"

An API can add a singular or plural form of an existing field. If the server adds such a field, an older doctl stops the user. The user cannot run create. The user must wait for a new doctl release.

The only other method is the deprecated apiVersion envelope, because the check ignores it. This method is not documented, and you plan to remove the envelope.

Please add a flag that changes these errors to warnings. The change is small. It replaces "the user is blocked until a new release" with "the user adds a flag and continues". The rest of doctl keeps the server as the authority. A hard error with no alternative is different from that design.

Problem 2: No check finds drift between the schema copy and the server

The test compares the key tree with the copy in testdata/. The copy has the date 2026-11-02. No CI job reads the live schema. As a result, the copy becomes old and no person sees this.

The copy is new today, so the risk is small now. The risk increases with time. This drift is the cause that changes Problem 1 from a theory into a user problem.

Please add a CI job. The job must compare the committed copy with the published schema.

Problem 3: The description of the near-miss rule is not correct

The description says "(and shorter than that key)". The rule in the code is d < len(candidate). The distance must be less than the length of the candidate. The length of the unknown key is not part of the rule. Please correct the table, because reviewers read it.

Problem 4: Confirm the behavior of the server

This change stops manifests that validate accepted before. This includes keepWarm and other camelCase names. The reason given is that the server rejects these names at create time.

This reason is probable, and it makes the change an improvement. It moves the failure to a point before the API call. But the full change depends on this reason. If the server accepts more names than doctl, doctl now stops correct work.

Please confirm the rule with the owner of the server decoder.

Conclusion

Approve after Problem 1. Problems 2, 3 and 4 are important, but they do not stop the merge.

best, bestDist := "", -1
for _, cand := range known {
d := editDistance(lower, cand)
if d > 2 || d >= len([]rune(cand)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This rule makes an error, not a warning. There is no flag to make it less strict.

Singular and plural pairs are the risk. A future server field named tool, secret, repo, label, mount, rule, defaults or paths is within distance 2 of a key in this tree. An older doctl stops such a manifest. The user cannot run create until a new doctl release.

Please add a flag that changes these errors to warnings.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added --allow-unknown-fields in 273fbee. It turns the "did you mean" near-miss errors into warnings, so a field newer than this doctl no longer blocks the command. Other errors are unchanged. It is registered on every command that has --strict (validate, create, launch, config create, trigger create/update). It cannot be combined with --strict or --from-config, and tests cover each of these.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I missed one gap in my earlier reply: trigger create and update accepted --allow-unknown-fields with --from-config. 5bdf889 now rejects it there, as create does, and a config's stored manifest no longer goes through the near-miss check at all.

// schema (free-text descriptions are removed; only the structure is compared).
// Keys for server features doctl does not support yet are left out of both the
// copy and the tree on purpose: a manifest using one gets the "unknown field"
// warning, which says it may be a newer field. To refresh the copy, copy the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test compares the tree with the committed copy. It does not compare the copy with the live schema. No CI job reads the live schema.

As a result, the copy becomes old and no person sees this. Please add a CI job that compares the committed copy with the published schema.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Partly addressed in 4062298. The key tree is now generated from commands/testdata/agent.flat.schema.json (go generate ./commands), so a schema refresh is: replace the copy, run the generator. TestManifestKeyTreeIsGenerated fails if the committed tree is stale, and the existing test still cross-checks the keys with a separate walk of the schema. The generated tree is identical to the hand-written one it replaces.

Still open: nothing compares the schema copy with the live schema. The published URL does not resolve from outside DigitalOcean's network, so a job on doctl's public runners likely cannot read it. The schema is edited in the cthulhu monorepo (contracts/agent.flat.schema.json), so the better home for that check is a cthulhu-side workflow, in the style of the existing plano proto sync, that opens a doctl PR when the schema changes. That needs a deploy key and Vault role, so I would do it as a follow-up and not in this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is no published URL to compare against. The $id does not resolve in DNS, and the source (contracts/agent.flat.schema.json in cthulhu) is on GHES, which doctl's runners cannot read. A check by hand did find drift: the copy lacked policy_profile, which the server has accepted since MARSOHS-2158, so validate --strict failed on a valid manifest. 357cfc2 refreshes the copy from cthulhu master and adds the key to the coverage fixture. For an ongoing check, I propose a cthulhu-side job that runs when that file changes. doctl is public, so the job can fetch this copy with no credentials and fail when the key sets differ. I would do that as a follow-up.

nveerdixit and others added 2 commits November 10, 2026 17:02
A field newer than this doctl that sits within two letters of a known key
(for example a singular/plural pair) was a hard error with no way past it
short of upgrading. --allow-unknown-fields reports those as warnings instead.
It is rejected together with --strict and --from-config.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nveerdixit

Copy link
Copy Markdown
Contributor Author

Review problem 3 (the near-miss rule in the description): fixed. The table now says the distance must be less than the known key's length, matching d < len(candidate) in the code. The description also documents --allow-unknown-fields (see 273fbee).

The key tree was kept by hand next to testdata/agent.flat.schema.json, so a
schema refresh meant editing about 100 lines to satisfy a failing test. A
generator now builds the tree from the copy (go generate ./commands), and
TestManifestKeyTreeIsGenerated fails if the committed tree is stale. The
generated tree is identical to the hand-written one it replaces.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@nveerdixit

Copy link
Copy Markdown
Contributor Author

Review problem 4 (does the server reject the same names?): I checked the server code in the cthulhu monorepo. The harness-api owner has not confirmed this yet.

What the code shows (harness-api/internal/agentspec/agentspec_flat.go):

  • The flat manifest is decoded with yaml.UnmarshalStrict into flatManifest, so the server rejects any unknown key at session create, near-miss or not. That is the behavior the doctl warning for other unknown keys describes.
  • The "did you mean" rule is the same as doctl's: edit distance at most 2 and less than the candidate's length (closestFlatField). The server checks one flat list of names across all nesting levels; doctl checks per object, so every doctl near-miss error names a key the server would also reject.

Not verified:

  • Whether the server accepts a key that differs only in letter case. doctl warns on these instead of erroring.
  • trigger create: the trigger path decodes only a subset of fields leniently, and full rejection happens at session create, so doctl's check there runs earlier than the server's.

I will leave this thread open until the harness-api owner confirms.

Comment thread commands/agent_triggers.go Outdated
return nil, err
}
if err := reportAgentManifestValidation(validateAgentManifest(manifest)); err != nil {
v := validateAgentManifest(manifest)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This runs for --from-config too, because the config's stored manifest is passed through the same validator. That conflicts with create, which rejects --strict and --allow-unknown-fields with --from-config because a config's manifest was already validated when it was created. Here the flags are registered and accepted.

The stored manifest is the server's JSON form. Any key the server added, or any key from an older schema, becomes a warning, and --strict turns it into an error you cannot fix by editing. I would either skip the unknown-key pass for --from-config or reject the two flags the same way create does.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 5bdf889. trigger create and update now skip the unknown-field pass for a --from-config manifest, since that is the server's stored copy. They also reject --strict and --allow-unknown-fields with --from-config, through the same helper create now uses. TestRunAgentTriggers_FromConfigSkipsUnknownFields covers both commands. A stored manifest with a server-only key (secret) creates the trigger with no warning, and each flag fails before any API call.

Comment thread commands/agents_manifest_keys.go Outdated
// doctl does not know). Messages carry the full path, for example
// permissions.network.<key> or mounts[0].<key>.
//
// The warning text must not contain "matches a declared", "looks like a

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This coupling depends on substring matching: config create promotes any warning containing "matches a declared", "looks like a credential" or "name suggests a credential" to an error, and this comment is the only guard. The unknown-field messages put the user's own key name into the text. A key that contains one of those phrases would be promoted to an error. A later rewording of either side would break it silently.

Can the validation result carry a typed severity or a Promote flag on the warning, instead of matching on text? Then neither side depends on the wording.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed in 836f217. The env credential checks now record their warnings in a Credentials subset as they raise them, the same way near misses are recorded, and config create promotes exactly those. No substring match is left, and the comment is gone. New cases in TestRunAgentsConfigCreate_UnknownKeys create a config with an unknown key named after each phrase, which stays a warning. They also check that real credential warnings are still promoted.

nveerdixit and others added 8 commits November 19, 2026 19:40
trigger create and update with --from-config copy the Agent Config's
stored manifest, which is the server's JSON form. Running the
unknown-field pass on it turned any key the server knows but this doctl
does not into a warning, or into a near-miss error the user could not
fix by editing and could not soften.

The trigger path now skips the unknown-field pass for --from-config and
rejects --strict and --allow-unknown-fields with --from-config, as
create already does. Both commands share one helper for that check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
config create promoted any manifest warning whose text contained
"matches a declared", "looks like a credential" or "name suggests a
credential" to an error. Unknown-field warnings quote the user's key, so
a key named after one of those phrases was promoted too, and rewording
either side would have broken the rule without a failing test.

The env credential checks now record their warnings in a Credentials
subset when they raise them, the same way near misses are recorded for
--allow-unknown-fields, and config create promotes exactly that subset.
Both moves share one helper. The comment that asked unknown-field
messages to avoid the phrases, and the test that enforced it, are gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The schema copy lacked the root key policy_profile, which the server
has accepted since MARSOHS-2158. validate warned that the server rejects
it, and --strict failed on a valid manifest.

The copy now matches cthulhu contracts/agent.flat.schema.json at
968f5d189ba6, with free-text descriptions removed as before. Only one
key is new: policy_profile. The other changes are values and
constraints, and the key check does not read them: the minimax-code
harness, egress "none", a required S3 mount endpoint, and the mount
path pattern.

valid_full.yaml now uses policy_profile so the fixture-coverage test
keeps covering every key. Its dry-run golden was regenerated with the
origin/main (b55fb88) binary, which reproduced the old golden byte
for byte before the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refreshed schema copy requires mount paths to match
^/workspace/[^/] (MARSOHS-2661), so the server would reject the
fixture's /data mount. Use /workspace/data instead.

The dry-run golden was regenerated the way it was first made: the
edited fixture was run through `doctl harness-runtime create --dry-run`
built from the PR base (81cef80), which reproduces the old golden
byte for byte from the old fixture. The other valid_*.yaml fixtures
already pass the schema copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`triggers create --session-mode reuse` and `triggers update` without
--spec or --from-config accepted --strict and --allow-unknown-fields,
then sent the request with no check and no message. Both now fail
before any API call and say why:

  --strict only applies to --session-mode=fresh; a reuse trigger has
  no manifest to check
  --strict needs a manifest to check; pass --spec

rejectManifestFlags holds the flag list, and the --from-config
rejection now calls it with its own reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On Windows the checkout gives agents_manifest_keys_tree.go CRLF line
endings while the generator emits LF, so TestManifestKeyTreeIsGenerated
reported the tree as stale. Normalize the committed side before
comparing, as the dry-run golden comparison already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanpj2292

Copy link
Copy Markdown
Contributor

Review notes.

  1. --strict on create --dry-run only checks unknown fields. The flag help (commands/agents.go:768) says "Treat manifest warnings (including unknown fields) as errors". But the dry-run branch (L1340) only runs the unknown-field check before printing; the full validator that applies strict to other warnings only runs on a real create. Example: a manifest with env: {OPENAI_API_KEY: sk-...} fails validate --strict but passes create --dry-run --strict and prints the key. Either run the full validation in dry-run or narrow the help, and add a test for it.
  2. --strict=false is rejected. rejectManifestFlags uses c.Doit.IsSet(flag) (L1248), so config create --from-config x --name y --strict=false errors out. Check the value (GetBool) instead.
  3. Unknown top-level keys print without the highlighted path. For foo_bar the output is foo_bar: unknown field "foo_bar" with no path highlight, because looksLikeFieldPath needs a . or a known prefix.
  4. Schema drift. Nothing checks commands/testdata/agent.flat.schema.json (1060 lines) against the published schema. Follow-up: a CI job that diffs it against the schema's $id URL.
  5. Simpler shape. There's a generator (commands/internal/manifestkeys), a generated tree, a staleness test and a second walker in agents_manifest_keys_schema_test.go. Embedding the schema with go:embed and building the key tree once at runtime would replace all four with one walker, at a small binary-size cost.

@sdharavath sdharavath left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

nveerdixit and others added 2 commits November 25, 2026 13:45
--strict on create --dry-run checked only unknown fields, so a manifest
with a credential in env passed it and printed the key. The dry run now
runs the same post-expansion validator as a real create, so it fails
where create would.

Also accept an explicit --strict=false or --allow-unknown-fields=false
where those flags are rejected, and highlight the path of a top-level
unknown key the way a nested one is.

Co-authored-by: Cursor <cursoragent@cursor.com>
The key tree was generated from the schema copy by a separate generator,
committed, and guarded by a staleness test plus a second schema walker in
the tests. Embed the schema and build the tree once at first use
instead: one walker, no generated file, nothing to go stale. The built
tree is identical to the generated one it replaces.

Building it costs about 0.6 ms, once per process and only on commands
that check a manifest; the binary grows by the 24 KB schema.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nveerdixit

Copy link
Copy Markdown
Contributor Author

@sanpj2292 thanks. All five are addressed in 9e16491 and 60be14c.

  1. --strict on create --dry-run: fixed. The dry run now runs the same validator as a real create, on the ${VAR}-expanded manifest, so it fails exactly where create would. Your example (env: {OPENAI_API_KEY: sk-...}) now fails create --dry-run --strict and prints nothing; without --strict it warns on stderr. A side effect worth knowing: a dry run now also fails on errors create would reject, such as an unknown adapter, where before it printed the manifest. The --strict help is accurate as written, so it is unchanged. Covered in TestRunAgentsCreate_DryRunUnknownKeys.
  2. --strict=false rejected: fixed. rejectManifestFlags reads the value with GetBool instead of IsSet, so an explicit =false passes and =true still fails. TestRejectManifestFlags_AcceptsExplicitFalse covers both flags.
  3. Top-level path highlight: fixed. A top-level unknown key is now printed with its path highlighted, like a nested one. TestUnknownTopLevelKeyMessagesSplitOnPath drives the real unknown-key messages through the splitter, so a rewording on either side fails it.
  4. Schema drift: still a follow-up, as in the earlier thread. The schema's $id does not resolve, and its source lives in a repository doctl's runners cannot read, so a doctl-side job has nothing to diff against. The workable shape is a job on the schema's side that fetches this public copy and fails when the key sets differ.
  5. Simpler shape: done. The schema is embedded and the key tree is built once at first use by one walker. The generator, the generated tree, the staleness test and the second walker are gone (net -427 lines). The built tree is identical, key for key and in order, to the generated one. Building it costs about 0.6 ms once per process, only on commands that check a manifest, and the binary grows by the 24 KB schema.

@sanpj2292

Copy link
Copy Markdown
Contributor

Thanks @nveerdixit. I checked the fixes against 9e16491f and 60be14c2:

  • Dry-run strict: printResolvedManifest now runs checkExpandedManifest before printing, which is the same check as a real create, so create --dry-run --strict fails exactly where create would.
  • --strict=false: rejectManifestFlags now reads the value with GetBool instead of IsSet.
  • Top-level path highlight: splitValidationPath now also recognises <key>: unknown field "<key>".
  • Simpler shape: the schema is embedded, and one sync.OnceValue walker builds the key tree. The generator, the generated tree and the second walker are gone.

Rebased onto current main, the tests show the same results as main under -race.

Follow-ups before or alongside merge:

  1. Behaviour-change note. A dry run can now fail on errors it used to print through, such as an unknown adapter. The description explains this in its own paragraph, but the Behavior change bullet only lists misspelled keys. Please add the dry-run change there too, so it lands in the release notes.
  2. Schema drift. Agreed that the check has to live on the schema's side. Please file a ticket for it (a job that fetches the public copy and fails when the key sets differ) and link it here.
  3. Refreshing the schema copy. The agentFlatSchema comment says keys for unsupported server features are left out on purpose. Please list which keys are left out, either in that comment or in the drift ticket, so the next person refreshing the copy doesn't silently add them back or drop new ones.
  4. Merge conflicts. This PR still conflicts with agents: create a config from an existing one, with a TUI #2001 (commands/agent_configs.go) and with MARSOHS-2589: default --permission to ask and print the applied policy #2112 and MARSOHS-2740: use DigitalOcean Inference for --model on claude-code and codex #2118 (commands/agents.go). Whichever of them merges later will need a rebase.

@SSharma-10

Copy link
Copy Markdown
Contributor

Please resolve the merge conflicts

nveerdixit and others added 2 commits November 26, 2026 12:25
…ixes

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	commands/agents.go
The copy matches the published schema of 2026-11-19 key for key. The
comment claimed keys were left out on purpose; none are. Name the two
keys added since, system_prompt and secrets.<name>.actor, so the next
refresh knows what it should pick up. MARSOHS-3157 tracks a drift check
on the schema's side.

Co-authored-by: Cursor <cursoragent@cursor.com>
@nveerdixit

Copy link
Copy Markdown
Contributor Author

@SSharma-10 @sanpj2292 merge conflicts are resolved and the follow-ups are done.

Conflicts: merged current main (e2e104dc) in 4dde8f59, a normal merge commit. The only conflict was in commands/agents.go, where this PR's rejectManifestFlags helpers and main's noteIgnoredVendorKey / hasKeyPlaceholder were added at the same spot; both are kept unchanged. gofmt, go vet ./commands/ are clean, and go test ./commands/ passes except TestRegistryLogout (keychain, also fails on main locally). The rebuilt binary still exits 1 on create --dry-run --strict with a ${VAR}-expanded credential in env and prints no manifest.

Follow-ups:

  1. Behavior-change note: the Behavior change bullet in the description now also says create --dry-run fails on any error a real create would reject.
  2. Schema drift: filed as MARSOHS-3157, a job on the schema's side that fetches this copy and fails when the key sets differ.
  3. Keys left out: none are. The copy matches the published schema of 2026-11-19 key for key, so the old comment was wrong. Two keys were added to the schema after that, system_prompt and secrets.<name>.actor. d01fabff rewrites the agentFlatSchema comment to name them, and the ticket lists them too.
  4. Conflicts with agents: create a config from an existing one, with a TUI #2001 / MARSOHS-2589: default --permission to ask and print the applied policy #2112 / MARSOHS-2740: use DigitalOcean Inference for --model on claude-code and codex #2118: MARSOHS-2740: use DigitalOcean Inference for --model on claude-code and codex #2118 is in main and merged cleanly. Whichever of agents: create a config from an existing one, with a TUI #2001 and MARSOHS-2589: default --permission to ask and print the applied policy #2112 merges later will need its own conflict fix.

Co-authored-by: Cursor <cursoragent@cursor.com>

# Conflicts:
#	commands/agents.go
@nveerdixit

Copy link
Copy Markdown
Contributor Author

Merged current main (424f37f, which includes #2111, #2112 and #2157) into this branch with an ordinary merge commit, 9ad0312. No rebase and no force-push.

One conflict, in commands/agents.go. #2112 moved the agentResumeOnTopoffFlagDesc doc comment below the permission and workspace descriptions. This branch adds agentAllowUnknownFlagDesc and agentStrictFlagDesc at the same spot. The resolution keeps both new constants and drops the duplicate comment, so main's layout stands. agents_run.go merged without conflicts, and #2112's ValidatePolicy stubs and --permission ask default are unchanged.

Checks run on the merge: gofmt -l and go vet ./commands/ are clean. go test ./commands/ passes except TestRegistryLogout, which needs the local keychain and fails the same way on main. With the rebuilt binary, create --dry-run --strict on a manifest with a credential in env still exits 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants