stateful / vscode-runme

DevOps Notebooks Built with Markdown - VS Code extension
https://runme.dev
Apache License 2.0
197 stars 16 forks source link

Separate output item for stderr? #1831

Open sourishkrout opened 2 days ago

sourishkrout commented 2 days ago

As follow up for https://github.com/stateful/vscode-runme/pull/1763. We still need to resolve.

Btw, this PR does not solve how to include stderr into the serialized notebook, as per:

and for non-interactive we could probably do:

  • stateful.runme/output-items
  • application/vnd.code.notebook.stdout
  • perhaps a third with application/vnd.code.notebook.stderr

Would a separate application/vnd.code.notebook.stderr output item work for you, @jlewi? Alternatively, stderr could be merged into the `application/vnd.code.notebook.stdout output item.

jlewi commented 12 hours ago

Yes; I think a separate output item would work fine. This would allow Foyle to easily include the stderr in the model prompt.

To consider the alternative, I think one downside of not merging stdout/stderr is that it can be harder to do so after the fact. So if a program is mixing stdout and stderr then errors might miss important contextual information. However, in this case we are talking about non-interactive mode and a motivation for using non-interactive mode (#684) is non-standard renderers. If your using a non-standard renderer then that arguably implies "stdout" and "stderr" should contain different content (e.g. JSON; vs. errors) and shouldn't be merged because that would interfere with the renderer.