Skip to content

feat: Pass on userFacingErrorMessages from chatwithtools task providers - #237

Open
marcelklehr wants to merge 1 commit into
mainfrom
fix/pass-on-provider-errors
Open

marcelklehr wants to merge 1 commit into
mainfrom
fix/pass-on-provider-errors

Conversation

@marcelklehr

Copy link
Copy Markdown
Member

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

Assisted-by: ClaudeCode:claude-opus-5
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Comment thread ex_app/lib/main.py
Comment on lines +190 to +191
# report_result() cannot send userFacingErrorMessage, so we call the endpoint ourselves.
# Nextcloud < 33 ignores the extra parameter.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ah, I still had an outdated dependency of nc_py_api

Comment thread ex_app/lib/nc_model.py
Comment on lines +81 to +88
def task_failed_error(task: Task) -> UserFacingError:
"""Turn a failed sub-task into an error that passes the provider's user-facing message on."""
if task.userFacingErrorMessage:
return UserFacingError(
f"Nextcloud TaskProcessing Task failed: {task.userFacingErrorMessage}",
task.userFacingErrorMessage,
)
return UserFacingError("Nextcloud TaskProcessing Task failed")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe it can extended to accept a admin message + user-side?
or are the Exceptions caught somewhere (I couldn't quite pin where the result is reported)?
it would be nice to report the admin error messages generated in context_agent too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Mh, as a consumer of task processing we don't have access to the admin-only errors :S

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants