dexaai / dexter

LLM tools used in production at Dexa
https://dexter.dexa.ai
MIT License
69 stars 4 forks source link

Make event args readonly #18

Open transitive-bullshit opened 9 months ago

transitive-bullshit commented 9 months ago

This continues the work in https://github.com/dexaai/dexter/pull/17 to make Dexter's core more immutable and easier to reason about.

Specifically, any of the objects passed to event handlers should be readonly to guarantee that event handlers don't have unintended side effects for future event handlers or internal functionality.

We may want to consider making other key objects like AbstractModel.params deep readonly as well.

transitive-bullshit commented 4 months ago

Bumping this now that #17 is merged. IIRC this was the cause of a nasty bug in Dexa awhile back.

rileytomasek commented 4 months ago

shouldn't this be fixed by replacing all of the methods that mutate state with extend?

transitive-bullshit commented 4 months ago

Possibly; it's been awhile since I've looked at this code. Feel free to close if this is handled already.