-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implement agent time recording and reporting to playground v2 #251
Implement agent time recording and reporting to playground v2 #251
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@satococoa Cloud you fix the CI error? |
services/external/stripe/config.ts
Outdated
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.
This change was made to avoid unnecessary initialization in testing and specific runtime environments, and to enable more flexible module mocking.
Previously, the Stripe instance was initialized immediately upon module import, causing errors during tests without an API key and making it difficult to mock.
By switching to lazy initialization — deferring the actual Stripe setup until the first time it’s accessed — we can now skip initialization during testing or easily swap in mock instances. As a result, our code becomes more testable, maintainable, and adaptable.
As an alternative, I also considered introducing vitest to leverage its advanced module mocking capabilities whith bun:test doesn't have.
However, transitioning to a different test framework would involve a large scope of changes, so I decided to postpone that option for now.
The lazy initialization approach provides a simpler, more incremental improvement to address our current needs.
@toyamarinyon Could you please:
Changes made:
Thank you for your time. |
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.
Verify that the retry recording agent properly integrates with the retry mechanism
Please tell me what and how do I verify it? Reviewing code? If should I do some operations, please let me know that.
await recordAgentUsageAction( | ||
currentExecution.runStartedAt, | ||
runEndedAt, | ||
currentExecution.durationMs, | ||
); | ||
|
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.
I would like to separate the recording of the execution from the context of the execution, so it would be better to make it a callback like onFinishPerformFlowExecution and add props like onFinishPerformFlowExecutionAction in the Provider. I think, but in this Pull request, it is fine as it is.
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.
Sorry. I thought I had commented on it, but it was Approve, so I will redo it.
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.
LGTM! ⏲️
Sorry for any confusion, simply I want you to re-review code. (Because conflict has occurred.) Conflicts is happening again, I'll fix it and request re-review again. |
…record-and-reporting-to-playground-v2
I've resolved the merge conflicts. |
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.
Thank you for resolving the conflict so many times!
Summary
Implement these changes into v2(current) playground.
Testing
agentActivities
andagentTimeUsageReports
are successfully saved