Skip to content

Simplify Update methods to do a whole object replace - #1108

Merged
Julian Gutierrez Oschmann (juli4n) merged 5 commits into
agent-substrate:mainfrom
laoj2:updates
Aug 24, 2026
Merged

Julian Gutierrez Oschmann (juli4n) merged 5 commits into
agent-substrate:mainfrom
laoj2:updates

Conversation

@laoj2

Copy link
Copy Markdown
Collaborator
  • Removed field_mask from the API
  • Added a new protoupdate package to handle replacing mutable fields. This makes sure that unknown fields in the server are not dropped by an update from a stale/old client.

#1011

  • Tests pass
  • Appropriate changes to documentation are included in the PR

@laoj2 Luiz Oliveira (laoj2) changed the title Simplify ActorUpdate to do a replace Simplify ActorUpdate to do a whole object replace Aug 20, 2026
Comment thread cmd/ateapi/internal/controlapi/actor.go Outdated
"worker_selector.match_labels",
// actorImmutableFields lists the Actor fields an update never takes from the
// request: the stored values win, whatever the client sends.
var actorImmutableFields = protoupdate.ImmutableFields[*ateapipb.Actor](

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I hope we don't need to enumerate this and can have a generic merge logic that works for all resources / fields. See my comment in #954 (comment)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Updated this PR based on our conversations. Now, we're doing:

serverOwned := storedObj[...]

proto.Reset(storedObj)
proto.Merge(storedObj, inputObj)
		
storedObj[...] = serverOwned		

One thing to note is that this operation retains all unknown fields from the input actor. But, we've been discussing what behaviour we want to keep in #954

@laoj2 Luiz Oliveira (laoj2) changed the title Simplify ActorUpdate to do a whole object replace Simplify Update methods to do a whole object replace Aug 24, 2026
@laoj2
Luiz Oliveira (laoj2) force-pushed the updates branch 3 times, most recently from 62b8b6b to 1d8ac1e Compare August 24, 2026 14:51
@juli4n
Julian Gutierrez Oschmann (juli4n) merged commit 31a2e38 into agent-substrate:main Aug 24, 2026
9 checks passed
@laoj2
Luiz Oliveira (laoj2) deleted the updates branch August 25, 2026 02:28
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.

2 participants