Skip to content

Conversation

Copy link

Copilot AI commented Nov 4, 2025

AI agents were instantiated with the OpenAI Agents SDK but had no tools parameter, preventing backend operations despite 26+ available BackendTools methods.

Changes

New file: utils/tools.js

  • 16 tool definitions wrapping BackendTools API:
    • Journal operations (create, get, update, search, tag management)
    • Memory/RAG operations (create, search, filter by type, stats)
    • Chat history access
  • Zod schemas with .optional().nullable() for OpenAI API compatibility
  • Arrays for tags, enums for memory types

Modified: utils/agents.js

  • Added tools parameter to all 9 Agent constructors
  • Agent-specific tool assignments based on role:
    • Supervisor (5): content creation, basic search
    • Retrieval (8): comprehensive search across all data sources
    • Memory (8): full CRUD on memory system
    • Tags (4): tag management + journal access
    • Others (3-4 each): role-appropriate subset

Added: verification tests

  • verify_tools.js: validates tool counts per agent
  • test_tool_integration.js: integration test template

Example Usage

import { run } from '@openai/agents';
import { tags_agent } from './utils/agents.js';

// Agent now automatically calls tools when LLM decides they're needed
const result = await run(tags_agent, "Tag my Python journal entries");
// Executes: get_journal_history() → add_tags(journalId, ["python", "programming"])

Verification

  • All 9 agents load with correct tool counts (42 total configurations)
  • CodeQL: 0 vulnerabilities
Original prompt

the tools for ai agents are not working. fix it


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@vercel
Copy link

vercel bot commented Nov 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mind-forge-server Error Error Nov 4, 2025 4:41pm
mind-forge-server-ebih Error Error Nov 4, 2025 4:41pm
mind-forge-server-wlat Ready Ready Preview Comment Nov 4, 2025 4:41pm

Co-authored-by: HaolongChen <62168247+HaolongChen@users.noreply.github.com>
Co-authored-by: HaolongChen <62168247+HaolongChen@users.noreply.github.com>
Co-authored-by: HaolongChen <62168247+HaolongChen@users.noreply.github.com>
Co-authored-by: HaolongChen <62168247+HaolongChen@users.noreply.github.com>
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