Skip to content

Add ad-hoc memory note tool#24562

Merged
jif-oai merged 1 commit into
mainfrom
jif/ad-hoc-tools
May 26, 2026
Merged

Add ad-hoc memory note tool#24562
jif-oai merged 1 commit into
mainfrom
jif/ad-hoc-tools

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 26, 2026

Why

Codex memory updates currently rely on instructions that tell agents to create ad-hoc note files directly in the memory workspace. The memories extension already has a MemoriesBackend abstraction for local storage and future non-filesystem backends, so the ad-hoc note writer should live behind that same interface instead of baking local filesystem assumptions into the tool shape.

What

  • Adds a memories/add_ad_hoc_note tool to the existing memories tool bundle.
  • Extends MemoriesBackend with add_ad_hoc_note plus request/response types so remote memory stores can implement the same operation later.
  • Implements the local backend by creating append-only notes under extensions/ad_hoc/notes.
  • Validates the tool-provided filename contract (YYYY-MM-DDTHH-MM-SS-<slug>.md), rejects path-like filenames, rejects empty notes, and uses create-new semantics so existing notes are never overwritten.
  • Keeps memories tool contribution behind the existing commented-out registration path; this defines the tool surface without newly exposing it through app-server.

Test Plan

  • just test -p codex-memories-extension

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 26, 2026

@codex review

@jif-oai jif-oai changed the title feat: add ad-hoc tool Add ad-hoc memory note tool May 26, 2026
Copy link
Copy Markdown
Contributor

@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: 3b14490c63

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
Err(err) => return Err(err.into()),
};
file.write_all(request.note.as_bytes())?;
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.

P0 Badge Bound ad-hoc notes before persisting

When the model/user supplies a large note, this writes it verbatim with no byte or token cap. The new file lives under the memories tree and can later be injected back into model-visible memory context through the memory tools/consolidation flow, so one ad-hoc note can exceed the repository's hard context-size guidance (>1k/10k-token items). Please reject or truncate oversized notes at the backend boundary rather than relying on the schema hint, which is not enforced by parse_args.

Useful? React with 👍 / 👎.

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.

No need

Comment thread codex-rs/ext/memories/src/tools/mod.rs
@jif-oai jif-oai merged commit 3936ed2 into main May 26, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/ad-hoc-tools branch May 26, 2026 10:23
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 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.

1 participant