-
Notifications
You must be signed in to change notification settings - Fork 124
mark AgentSessionState snapshot and delta optional #1399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
paulwe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will always be one or the other so maybe oneof?
|
the new session state should be a db with empty tables. if the schema the sdk needs changes in later versions this avoids ongoing maintenance to keep them synced |
when cloud thinks the work has the full state, it should only set the version but not snapshot and delta? |
|
oh, right... undefined is a valid oneof state ( |
|
we will have a schema version in the db, if the schema version from the snapshot is not matched to the one in agent sdk, either we raise an error or automatically convert it to the new schema and sync a new snapshot to the cloud. so the cloud doesn't need to care about the schema of the db. |
|
so the new session state can be an empty byte? it make the sdk easier to determine it's a new session |
|
no, it can't be empty bytes... that's what i wanted to clarify since you were disambiguating the zero and undefined states |
|
why it cannot be empty bytes... can we distinguish "not set" and empty value if we check the field with |
|
cloud to worker:
worker to cloud
|
|
I was thinking "version - undefined oneof" means the hot sync that only a version is sent to the worker and "version + empty snapshot" means a new session (or discard previous data if any) |
|
|
|
you're right. maybe this? - cloud to worker:
|
| string agent_name = 3; | ||
| string metadata = 4; | ||
| AgentSessionState session_state = 5; | ||
| optional AgentSessionState session_state = 5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
messages are always optional it doesn't have to be explicitly optional
cloud to worker:
worker to cloud: