Skip to content
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

Simplify actions typing #11390

Merged
merged 14 commits into from
Mar 16, 2025
Merged

Simplify actions typing #11390

merged 14 commits into from
Mar 16, 2025

Conversation

Fraggle
Copy link
Contributor

@Fraggle Fraggle commented Mar 16, 2025

Description

Finally, simplify all actions types and code by:

  • folding action types declarations into one file per action.
  • simplify constructor blobs

Tests

Type-check + local

Risk

Low

Deploy Plan

Deploy front, monitor errors.

@Fraggle Fraggle requested review from spolu and flvndvd March 16, 2025 07:26
Copy link

github-actions bot commented Mar 16, 2025

Warnings
⚠️

Files in **/lib/models/ have been modified and the PR has the migration-ack label. Don't forget to run the migration from prodbox.

Generated by 🚫 dangerJS against 13ef886

@Fraggle Fraggle added migration-ack 📁 Label to acknowledge that a migration is required. sdk-ack Used to acknowledge that you are not breaking the public API. documentation-ack Used to acknowledge that documentation is up-to-date with this PR and removed sdk-ack Used to acknowledge that you are not breaking the public API. labels Mar 16, 2025
Copy link
Contributor

@spolu spolu left a comment

Choose a reason for hiding this comment

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

Nice! Left 2 questions.


export class ConversationIncludeFileAction extends BaseAction {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm this is a bit of a divergence from what we have done so far with -Type object bien pure types vs classes.

Can we keep the original name out of consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I overlooked this. Fixing.

Copy link
Contributor Author

@Fraggle Fraggle Mar 16, 2025

Choose a reason for hiding this comment

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

@spolu actually, it was not the case, we were already passing classes as "Type":

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(the previous types were also extending "BaseAction" class)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here actions comes from AgentMessageType's actions property which is filled in batchRenderAgentMessages that in turn call xxxActionTypesFromAgentMessageIds() that construct an instance of xxAction "the class" but says it returns xxActionType. Type checking do not complains but XXXActionType was indeed a class there (hence our ability to class renderXXX on them later).

Copy link
Contributor Author

@Fraggle Fraggle Mar 16, 2025

Choose a reason for hiding this comment

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

For now:

  • Option 1: remove "Type" suffix (but then we'll have AgentMessageType containing a non Type thing
  • Option 2: keep the "Type" suffix out of constency with the previous state of affair.

None of theses are great but the real solution is more involved and out of scope.

My take is option 2.

Copy link
Contributor

@spolu spolu Mar 16, 2025

Choose a reason for hiding this comment

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

Yep let's do 2 👍👍

@spolu
Copy link
Contributor

spolu commented Mar 16, 2025

The -Type objects are simple JSON that can be serialised and deserialised at will in all of our codebase so this is introducing quite a big inconsistency here imho. Should we keep them? It's not much added complexity is it?

Copy link
Contributor

@spolu spolu left a comment

Choose a reason for hiding this comment

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

LGTM post consistency fix

@Fraggle Fraggle merged commit 4217fb3 into main Mar 16, 2025
7 checks passed
@Fraggle Fraggle deleted the sflory-simplify-actions-typing branch March 16, 2025 10:36
frankaloia pushed a commit that referenced this pull request Mar 17, 2025
* Simplify TableQuery action

* Simplify Browse action

* Simplify DustAppRun action

* Simplify Process action

* Simplify Reasoning action

* Simplify Retrieval action

* Simplify Search Labels action

* Simplify Websearch action

* Simplify IncludeFile action

* Simplify ListFiles action

* Final simplification

* Put back skip ts-error from philippe

* Fix: import of server side stuff

* Remove unused code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation-ack Used to acknowledge that documentation is up-to-date with this PR migration-ack 📁 Label to acknowledge that a migration is required.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants