Conversation
…file("rtemis_security_log_", fileext = ".jsonl"))
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Code Review
This pull request updates the package to version 0.8.1, adds API documentation links, and introduces a verbosity parameter to the available_tools function. It also modifies the security logging logic to use getOption with a temporary file fallback to satisfy CRAN policies. A high-severity bug was identified in the Agent's generate method, where the removal of the default logfile fallback could result in a NULL value being passed to the logging function, causing a crash during security incident reporting.
There was a problem hiding this comment.
Pull request overview
Updates the rtemis.llm package for CRAN readiness by tightening documentation, metadata, and defaults (notably around tool listings and security/audit logging) while fixing minor example syntax issues.
Changes:
- Refresh package metadata (version/date/Description URLs) and add bug-report links.
- Make
available_tools()support averbosityargument and document it. - Adjust security logging defaults to avoid writing into the working directory, and clean up examples/docs.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| r/man/rtemis.llm-package.Rd | Adds GitHub issues link in “Useful links”. |
| r/man/responses.Rd | Fixes example call syntax (adds missing comma). |
| r/man/reasoning.Rd | Fixes example call syntax (adds missing comma). |
| r/man/llmapply.Rd | Fixes example call syntax (adds missing comma). |
| r/man/available_tools.Rd | Documents new verbosity parameter and updated return wording. |
| r/R/zzz.R | Cleans comments and changes startup message emoji. |
| r/R/utils_security.R | Moves incident log default to getOption(..., tempfile(...)) to satisfy CRAN expectations. |
| r/R/map.R | Fixes roxygen example call syntax (adds missing comma). |
| r/R/07_Agent.R | Updates logfile documentation and changes logfile resolution in generate.Agent. |
| r/R/00_init.R | Implements available_tools(verbosity = 1L) behavior (conditional printing). |
| r/DESCRIPTION | Bumps version/date and adds explicit endpoint URLs in Description. |
| Makefile | Ensures document-r runs formatting first. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "rtemis_security_logfile", | ||
| tempfile("rtemis_security_log_", fileext = ".jsonl") | ||
| ) | ||
| ) { |
There was a problem hiding this comment.
Because generate.Agent passes logfile = logfile explicitly, this default only applies when the argument is omitted; if logfile is explicitly NULL, the fallback here won’t run and incident logging will write to stdout instead of a file. To make logging robust, defensively coerce NULL to the getOption/tempfile fallback inside the function body (or avoid passing NULL from the caller).
| ) { | |
| ) { | |
| if (is.null(logfile)) { | |
| logfile <- getOption( | |
| "rtemis_security_logfile", | |
| tempfile("rtemis_security_log_", fileext = ".jsonl") | |
| ) | |
| } |
| #' @field logfile Optional character: Path to the agent's security log. Important! If NULL, the package | ||
| #' defaults to | ||
| #' `getOption("rtemis_security_logfile", tempfile("rtemis_security_log_", fileext = ".jsonl"))` to | ||
| #' satisfy CRAN policy. It is important to set it to a non-temporary location that will persist | ||
| #' and you can access. Otherwise, security incidents may be missed. Can be overridden per call | ||
| #' on [generate]. |
There was a problem hiding this comment.
The docstring says the package defaults the agent logfile to getOption("rtemis_security_logfile", tempfile(...)) when logfile is NULL, but the Agent constructor currently stores logfile = NULL without resolving it. Either implement this default resolution (e.g., in the constructor or generate path) or adjust the documentation so it matches actual behavior.
| #' @field logfile Optional character: Path to the agent's security log. Important! If NULL, the package | |
| #' defaults to | |
| #' `getOption("rtemis_security_logfile", tempfile("rtemis_security_log_", fileext = ".jsonl"))` to | |
| #' satisfy CRAN policy. It is important to set it to a non-temporary location that will persist | |
| #' and you can access. Otherwise, security incidents may be missed. Can be overridden per call | |
| #' on [generate]. | |
| #' @field logfile Optional character: Path to the agent's security log. If NULL, no agent-level | |
| #' logfile path is stored on the object. For persistent security logging, set this to a | |
| #' non-temporary location that will persist and you can access. Otherwise, security incidents | |
| #' may be missed. Can be overridden per call on [generate]. |
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
No description provided.