Skip to content

Avoid fatal TUI errors on skills list failure#18061

Merged
etraut-openai merged 2 commits intomainfrom
etraut/skills-list-panic
Apr 16, 2026
Merged

Avoid fatal TUI errors on skills list failure#18061
etraut-openai merged 2 commits intomainfrom
etraut/skills-list-panic

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

Addresses #17951

Problem: The TUI treated skills/list failures as fatal during refresh, so proxy/firewall responses that break plugin discovery could crash the session.

Solution: Route startup and refresh skills/list responses through shared graceful handling that logs a warning and keeps the TUI running.

Comment thread codex-rs/tui/src/app.rs
})
.await?;
self.handle_skills_list_response(response);
self.handle_skills_list_result(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this take the return value and return it with Ok instead of hardcoding Ok(true) below?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[codex] I agree the ignored return value is awkward, but I don't think we should propagate false here. In this method, Ok(false) means "this op was not handled" and would fall through to a user-visible "Not available in TUI yet" message. For a failed skills refresh, we want the op to count as handled while the refresh itself degrades gracefully. I'll remove the helper's boolean return instead so this is clearer.

Comment thread codex-rs/tui/src/app.rs
app_server: &mut AppServerSession,
thread_id: ThreadId,
op: &AppCommand,
) -> Result<bool> {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be forced to return bool rather than Result?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[codex] I think try_submit_active_thread_op_via_app_server should stay Result<bool> because most branches still represent important app-server failures that should bubble up. The narrower fix is to make only skills/list fail-open, since plugin/skills discovery is noncritical. I'll change the skills helper to return () so the intent is explicit without broadening error swallowing.

Comment thread codex-rs/tui/src/app.rs
}
}

fn handle_skills_list_result(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

To make this a more meaningful helper, maybe this should take app_server, cwds, and force_reload and make the skills_list() call and then handle the Result internally?

Up to you: I don't feel strongly either way.

@etraut-openai etraut-openai merged commit ff9744f into main Apr 16, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/skills-list-panic branch April 16, 2026 17:30
@github-actions github-actions bot locked and limited conversation to collaborators Apr 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants