Skip to content

Add user-scoped previous conversation tools - #2203

Open
BlueHotDog wants to merge 5 commits into
mainfrom
feat/previous-conversation-tools
Open

BlueHotDog wants to merge 5 commits into
mainfrom
feat/previous-conversation-tools

Conversation

@BlueHotDog

@BlueHotDog BlueHotDog commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the two-tool design with one read-only previous_conversations tool: search the authenticated user's earlier conversations, list selected task interactions, and page through selected text.
  • Keep task ownership checks and bounded database selection in the Tasks context. Project message text, question answers, and validated todo state through Tasks.History; never expose arbitrary tool-result bodies.
  • Clarify diagnostic-access guidance without adding private connection details.

The PR is 506 added and 9 removed lines (497 net); application code is 362 added lines. Historical content is labeled as reference material, not current instructions. The tests use real completed turns.

Validation

  • MIX_TEST_DB_SUFFIX=_previous_conversations_delta_newbase mise exec -- make precommit TEST_ARGS='--max-cases 8' — 1,196 passed, 5 skipped, 2 excluded; format, strict compile and Credo passed.
  • Default-concurrency runs on the earlier revision timed out in existing 100 ms MCPDiagnosticsTest assertions; those tests passed alone and the full suite passed at max-cases 8.
  • No live model-provider conversation or deployment was run.

A direct CHANGELOG.md entry covers this server-side feature; no publishable package needs a changeset.

…ation-tools

# Conflicts:
#	.agents/skills/diagnose-agent-feedback/SKILL.md
#	.agents/skills/diagnose-agent-feedback/references/production-access.md
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T19:19:14.519719Z 75fe0cb New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: d695b3e21a

ℹ️ 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".

where: i.task_id in ^task_ids and i.type in [:user_message, :agent_response],
where:
fragment(
"strpos(lower(coalesce(?->>'content', ?->'messages'->>0, '')), lower(?)) > 0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Search every text block in a user message

When a prior user message contains multiple text blocks and the search term appears only in the second or later block, this predicate silently excludes the conversation because it examines only messages[0]. Interaction.UserMessage.attrs/3 persists every text block in messages, and ReadPreviousConversation.readable_text/1 joins all of them, so searchable history differs from readable history. Search all message strings and build the excerpt from the matching text rather than restricting both expressions to the first element.

Useful? React with 👍 / 👎.

Comment thread apps/frontman_server/config/config.exs Outdated
Comment on lines +35 to +37
FrontmanServer.Tools.FindPreviousConversations,
FrontmanServer.Tools.GetToolResult,
FrontmanServer.Tools.ReadPreviousConversation,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Add a changelog entry for the new conversation tools

This commit exposes two new user-facing tools but includes neither a changeset nor a direct changelog update; I checked the complete changed-file list. The root AGENTS.md requires notable changes to be recorded and limits skip-changelog to chore/docs-only changes. Although .github/workflows/changelog-check.yml exempts changes without publishable packages from its coverage check, that exemption does not satisfy the repository's documented release-note requirement. Add a changelog entry describing the new history-search capability.

AGENTS.md reference: AGENTS.md:L65-L66

Useful? React with 👍 / 👎.

Comment on lines +1 to +2
defmodule FrontmanServer.Tools.PreviousConversationsTest do
use FrontmanServer.DataCase, async: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Split the change below the repository's net-new-line limit

The reviewed commit adds 756 lines and removes 9, totaling 747 net-new lines, exceeding the root AGENTS.md requirement to keep PRs below 500 net-new lines. Split this work into smaller reviewable changes, including separating the unrelated production-diagnostic guidance, while retaining integration coverage for the new tools.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
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.

1 participant