Skip to content

Conversation

@krpeacock
Copy link
Contributor

Description

The agent currently outputs console logs, warnings, and errors to the console.

This introduces an Observer pattern, available as a public ["log"] attribute which returns a new type of AgentLog. Developers can add listeners to hook into the logs, and a new flag (logToConsole) is provided, which will output these logs to the console.

This is turned off by default.

How Has This Been Tested?

new unit tests

Checklist:

  • My changes follow the guidelines in CONTRIBUTING.md.
  • The title of this PR complies with Conventional Commits.
  • I have edited the CHANGELOG accordingly.
  • I have made corresponding changes to the documentation.

@krpeacock krpeacock requested a review from a team as a code owner February 7, 2024 19:18
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2024

size-limit report 📦

Path Size
@dfinity/agent 100.18 KB (+0.31% 🔺)
@dfinity/candid 13.61 KB (0%)
@dfinity/principal 5.04 KB (0%)
@dfinity/auth-client 91.79 KB (+0.07% 🔺)
@dfinity/assets 91.96 KB (+0.03% 🔺)
@dfinity/identity 89.09 KB (+0.05% 🔺)
@dfinity/identity-secp256k1 263.22 KB (+0.14% 🔺)

@krpeacock krpeacock requested a review from a user February 7, 2024 20:34
@krpeacock krpeacock enabled auto-merge (squash) February 7, 2024 20:40
if (!this._rootKeyFetched) {
// Hex-encoded version of the replica root key
this.rootKey = ((await this.status()) as any).root_key;
this.rootKey = ((await this.status()) as JsonObject & { root_key: ArrayBuffer }).root_key;
Copy link

Choose a reason for hiding this comment

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

What's going on here? This doesn't seem related to the description of the PR.

Copy link
Contributor Author

@krpeacock krpeacock Feb 7, 2024

Choose a reason for hiding this comment

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

ah, just cleaning up a linting warning in the file since I was touching it. Eventually I'd like to have no use of any in the codebase

@krpeacock krpeacock merged commit abcc155 into main Feb 7, 2024
@krpeacock krpeacock deleted the kai/agent-observer branch February 7, 2024 21:00
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.

1 participant