Skip to content

feat(execd): extract exit_code for command error output#523

Open
Pangjiping wants to merge 1 commit intoalibaba:mainfrom
Pangjiping:feat/run_command_exit_code
Open

feat(execd): extract exit_code for command error output#523
Pangjiping wants to merge 1 commit intoalibaba:mainfrom
Pangjiping:feat/run_command_exit_code

Conversation

@Pangjiping
Copy link
Collaborator

Summary

  • extract exit_code for command error output

Testing

  • Not run (explain why)
  • Unit tests
  • Integration tests
  • e2e / manual verification

Breaking Changes

  • None
  • Yes (describe impact and migration path)

Checklist

  • Linked Issue or clearly described motivation
  • Added/updated docs (if needed)
  • Added/updated tests (if needed)
  • Security impact considered
  • Backward compatibility considered

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 526b62fad2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +209 to +210
// ExitCode is the exit code of the command
ExitCode int `json:"exit_code"`

Choose a reason for hiding this comment

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

P2 Badge Omit exit_code when no process exit code exists

Because ErrorOutput is reused for non-command failures and ServerStreamEvent.ToJSON marshals it directly (components/execd/pkg/web/model/codeinterpreting.go:99-101), making ExitCode a plain int means every error that does not explicitly set it will now serialize as "exit_code": 0. That affects ordinary interpreter/SQL failures such as ContextCancelled (components/execd/pkg/runtime/jupyter.go:121-124) and DBInitError (components/execd/pkg/runtime/sql.go:45-47), so any client that starts trusting the new field will misread “no exit code available” as a successful process exit.

Useful? React with 👍 / 👎.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, add an unified exit status code 255 for these non-command execution failures, to avoid the ambiguity caused by exit_code=0.

@Pangjiping Pangjiping force-pushed the feat/run_command_exit_code branch from 6cb66ac to e359efb Compare March 22, 2026 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/execd feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants