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

Add tests to AI event logging #1602

Merged
merged 3 commits into from
Sep 3, 2024
Merged

Conversation

sourishkrout
Copy link
Member

@sourishkrout sourishkrout commented Aug 30, 2024

See diff, please, @jlewi.

@@ -692,7 +692,7 @@ export class Kernel implements Disposable {
}

TelemetryReporter.sendTelemetryEvent('cell.startExecute')
getEventReporter().reportExecution(cell)
await getEventReporter().reportExecution(cell)
Copy link
Contributor

Choose a reason for hiding this comment

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

@sourishkrout Won't this block execution below? For example, suppose the Foyle service is down. We might reasonably expect the eventReporter to buffer the events and perform some retrying. But I don't want to block actual cell execution. Is there a better pattern to achieve this?

Copy link
Member Author

@sourishkrout sourishkrout Aug 30, 2024

Choose a reason for hiding this comment

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

Yes. I incorrectly assumed the noop event reporter would be unless the "AI experiment" is turned on.

I agree with you about this. I figured there are likely a few things that need to be addressed to move to a smooth "out-of-the-box" experience.

We could rewrite the Reporter to resemble the telemetry one (don't love the impl either actually), where it separates producing (enqueuing) and reporting the events. However, I'd suggest that for the time being, we use the noop logger unless AI is turned on. And track a separate effort to make this default robust.

I can rewrite this reasonably quickly at a later point. Wdyt @jlewi?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link

sonarcloud bot commented Aug 31, 2024

@sourishkrout sourishkrout merged commit d136c1b into jlewi/logevents Sep 3, 2024
3 checks passed
@sourishkrout sourishkrout deleted the seb/test-logevents branch September 3, 2024 22:11
jlewi added a commit that referenced this pull request Sep 4, 2024
* Start writing the code to log events.

* Update foyle buf package to pull in the events protos.

* Rough version of the code.

* Update the connect package for Foyle.

* Latest version; to try to show the problematic line

* Bug fix: AIManager doesn't properly get the configuration for baseURL

* We weren't actually reading the baseURL from the config because
  the key should be "aiBaseURL" not "runme.aiBaseURL"

* I tried to add logging to ensure we know what the actual value of the
  endpoint is but that seemed to prevent the extension from loading.

* Include context in execution events.

* Fix test.

* Define a sessionmanager to manager the context ID so we can attach it to requests.

* Include the selected index in the events.

* Log accepted suggestions.

* Log session starts and ends.

* Revert examples.

* Initialize the logger properly.

* Add ULID

* Add a ULID to events

* Add return

* Add todo

* Cherry-pick Sebastian's change bc2b0ac

* Add tests to AI event logging (#1602)

* Add to tests

* Add todo

* Let vs var

---------

Co-authored-by: Sebastian Tiedtke <sebastiantiedtke@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants