Strange error when using Kaimon

I often get this error message when AI is executing code that is precompiling a package:

SYSTEM: caught exception of type :ErrorException while trying to print a failed Task notice; giving up

What could be the reason?

Hi there … this error message is in general not a concern, it has to do with the way precompilation tasks utilize the stdio channels, which are redirected to allow Kaimon to send IO to and from the agent.

I’ve attempted to figure out a workaround for this but the way the precompilation code works inside Julia’s internals is such that I have failed so far. I could potentially hide the message as I believe it’s harmless and just represents that the precompilation was trying to print some output and wasn’t able to, due to the issues I mentioned above.

I’d say, safe to ignore as far as I know. If you think it should be hidden, let me know.

IJulia also has this problem, should be fixed in the future by Move precompilation during package loading behind `@invokelatest` - Pull Request #60727 - JuliaLang/julia - GitHub.

Is it also sort of a “non-problem” there? When I’ve investigated this and tried to solve it, it’s always seemed like it didn’t really result in any problem in the end. The precompilation seemed to still happen and it has seemed like an annoying yet harmless condition. Since it only happens during initial compilation of dependencies, I’ve begun to just treat it as noise.

But I understand it’s not something you want to see, it raises questions, it suggests something is not right. I’ve held back on my urge to suppress this message by erasing it when it happens.

Yeah I think it’s fine, IIRC the printing happens in a separate task so it doesn’t affect anything else.