Skip to content

Refactor event types to enum#407

Closed
loop-index wants to merge 16 commits intoantinomyhq:mainfrom
loop-index:main
Closed

Refactor event types to enum#407
loop-index wants to merge 16 commits intoantinomyhq:mainfrom
loop-index:main

Conversation

@loop-index
Copy link
Copy Markdown

/claim #403
/closes #403

Right now, I have refactored 3 event types that I found in the codebase to enum values. Since agent initialization is parsed from workflow files, I am assuming that agent.transforms can contain custom event types, so I kept a function for creating custom events. I am not too familiar with Rust, so please let me know if there's anything that needs to be fixed or improved for better practice/efficiency/etc.

I also used Forge itself for this refactor. It was my first time using it, and it helped a lot by charting out the affected areas and how the functions are connected throughout the project. My only problem is that I ran out of OpenRouter credits during prompting, and adding more credits doesn't seem to reflect in the current session; I had to exit out and start a new session, which means the original context is lost. I might be doing something wrong, but if it's a real issue then it might be a potential future fix.

@github-actions github-actions bot added the type: chore Routine tasks like conversions, reorganization, and maintenance work. label Feb 27, 2025
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath left a comment

Choose a reason for hiding this comment

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

Appreciate the feedback @loop-index
Technically from an open-router's point of view, there is no "session" Each request contains the whole context that's increasing each step. May be the /retry PR will help fixing this or if you can create a repro, we could find a fix for it.

@loop-index
Copy link
Copy Markdown
Author

Gotcha, I will look into it later. About the tests, I ran them before making any changes and noticed some integration tests failing. Those same tests are also the only ones failing in the CI check, so I don't think it was from my end.

@tusharmath tusharmath marked this pull request as draft February 27, 2025 12:11
@tusharmath
Copy link
Copy Markdown
Collaborator

Please fix the CI issues.
Moving to draft to reduce noise and improve CI efficiency. Once you are ready just mark it as "ready to review". Feel free to give a shoutout on the #contributors channel on Discord if you want immediate attention.

@loop-index loop-index marked this pull request as ready for review February 27, 2025 19:12
@loop-index
Copy link
Copy Markdown
Author

@tusharmath can you approve the checks so I can see if the fixes pass the CI check? Alternatively, you mentioned dropping the flaky tests in #411, is that still an option?

@loop-index
Copy link
Copy Markdown
Author

Seems like it's still failing on the flaky env vars tests. I've applied the fixes from #411 and got all tests passing on my local. Should those tests be dropped?

@tusharmath
Copy link
Copy Markdown
Collaborator

Hi there! 👋

I wanted to let you know that we've fixed the flaky test issue in the main branch. This was causing CI failures in many PRs, including this one.

Could you please back-merge main into your branch to get these fixes? This should resolve the CI failure you're seeing.

Steps to back-merge:

git checkout your-branch-name
git pull upstream main  # Or: git pull origin main (depending on how you've set up your remote)
git push

Let me know if you have any questions or need assistance with the process!

Thank you for your contribution! 🙌

@tusharmath tusharmath marked this pull request as draft March 1, 2025 06:18
@loop-index loop-index reopened this Mar 1, 2025
@loop-index loop-index marked this pull request as ready for review March 1, 2025 08:26
@loop-index
Copy link
Copy Markdown
Author

Pulled in the fixes from main and merged with my changes.

@tusharmath
Copy link
Copy Markdown
Collaborator

/tip $20

@algora-pbc
Copy link
Copy Markdown

algora-pbc bot commented Mar 1, 2025

🎉🎈 @loop-index has been awarded $20! 🎈🎊

@tusharmath
Copy link
Copy Markdown
Collaborator

@loop-index I thought about this change again and I feel like it's a bit too soon to make this refactor. Thanks anyways! Hope to see more contributions from your side.

@tusharmath tusharmath closed this Mar 1, 2025
@loop-index
Copy link
Copy Markdown
Author

I understand. Thank you for your assistance throughout!

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

Labels

type: chore Routine tasks like conversions, reorganization, and maintenance work.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor DispatchEvent to use enum for type-safety

2 participants