-
Notifications
You must be signed in to change notification settings - Fork 7.9k
fix: report an appropriate error in the TUI for malformed rules #9011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -30,16 +30,14 @@ pub(crate) fn spawn_agent( | |||||||||||||||||||||||||||||||||||||||||||||||||
| .. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } = match server.start_thread(config).await { | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @etraut-openai to answer your question about "Will this also work for api service clients like the IDE extension?" I believe the crux of the issue is how the UI deals with an I believe it is already doing the right thing here: codex/codex-rs/app-server/src/codex_message_processor.rs Lines 1333 to 1356 in 3c711f3
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm working on a new PR that surfaces config parsing errors correctly to app server clients. I'll extend it to handle malformed rules errors as well. |
||||||||||||||||||||||||||||||||||||||||||||||||||
| Ok(v) => v, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| #[allow(clippy::print_stderr)] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Err(err) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| let message = err.to_string(); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| eprintln!("{message}"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| let message = format!("Failed to initialize codex: {err}"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| tracing::error!("{message}"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| app_event_tx_clone.send(AppEvent::CodexEvent(Event { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| id: "".to_string(), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| msg: EventMsg::Error(err.to_error_event(None)), | ||||||||||||||||||||||||||||||||||||||||||||||||||
| })); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| app_event_tx_clone.send(AppEvent::ExitRequest); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| tracing::error!("failed to initialize codex: {err}"); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| app_event_tx_clone.send(AppEvent::FatalExitRequest(message)); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| return; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this runs only in interactive mode. What about non-interactive mode (
codex exec)? I think we'd want this same error printed in that case.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This already appears to work as intended for
codex exec: