codex-5-cli eating through all my limit from one prompt by trying to paste full file contents in the context

Resolved 💬 2 comments Opened Nov 13, 2025 by aric-vw Closed Jan 10, 2026

What version of Codex is running?

codex-cli 0.55.0

What subscription do you have?

Plus

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.5.0 arm64 arm

What issue are you seeing?

the responses from the cli were starting to try to paste full code file content into the MCP tool calls, resulting in a very very fast usage of my usage limit. It didn't complete its task either.

What steps can reproduce the bug?

Uploaded thread: thread ID 019a7def-4ead-7091-945e-ebd5faf2a710

here's an example of the mcp tool call

  └ RepoPrompt.chat_send({"message":"Understood—here are the full current contents of each
        file.\n\n1. `src/app/components/notes/filters/ActiveFilterChips.tsx`\n```tsx\n\"use
        client\";\n\nimport { useMemo, startTransition, useState, useEffect } from \"react\";
        \nimport { usePathname, useParams, useSearchParams } from \"next/navigation\";
        \nimport {\n  useNoteTypesParam,\n  useAuthorIdsParam,\n  useTagsParam,\n
        usePinnedParam,\n  useNoteTypesOpParam,\n  useAuthorIdsOpParam,\n  useTagsOpParam,
        \n  useAuthorRelationshipParam,\n  useNotesSearchParam,\n  useTargetIdParam,
        \n  useDateFromParam,\n  useDateToParam,\n  useUserTeamParam,\n  useNoteIdParam,
        \n} from \"@/hooks/use-notes-params\";\nimport {\n  FilterType,\n  FilterOperator,
        \n  Filter,\n  getFilterTypeOption,\n  getOperatorLabel,\n  getAvailableOperators,
        \n} from \"@/app/components/notes/filters/types\";\nimport FilterValueSelector from
        \"@/app/components/notes/filters/FilterValueSelector\";\nimport FilterChip from \"@/
        app/components/notes/filters/FilterChip\";\nimport { extractNoteContext } from \"@/
        lib/helpers/notes/context\";\nimport { getContextName } from \"@/lib/actions/
        notes/get-context-name\";\nimport { useNotes } from \"@/providers/notes\";\nimport
        { DateRangePicker, Button } from \"@heroui/react\";\nimport { parseDate, CalendarDate }
        from \"@internationalized/date\";\n\nimport { useCurrentUser } from \"@/hooks/use-
        current-user\";\nimport { getAdviseeTeams } from \"@/lib/actions/notes/get-advisee-
        teams\";\n\ntype ActiveFilterChipsProps = {\n  className?: string;\n  availableAuthors?:
        Array<{ id: string; name: string }>;\n  availableTags?: string[];\n  availableNoteTypes?:
        string[];\n  availableAuthorRelationships?: Array<{ value: string; label: string }
        >;\n  onFilterTypeClick?: (filterType: FilterType) => void;\n};\n\n/**\n * Displays
        active filters as segmented chips with three distinct parts:\n * 1. Filter type
        (clickable to reopen filter menu)\n * 2. Operator (dropdown to change operator)\n * 3.
        Value(s) (popover to modify selections)\n * 4. Close button (X to remove filter)\n *\n
        * Follows the 21st.dev pattern with segmented, interactive filter chips\n */\nexport
        default function ActiveFilterChips({\n  className = \"\",\n  availableAuthors = [],\n
        availableTags = [],\n  availableNoteTypes = [],\n  availableAuthorRelationships = [],\n}:
        ActiveFilterChipsProps) {\n  // URL parameter hooks\n  const [noteTypes, setNoteTypes] =
        useNoteTypesParam();\n  const [authorIds, setAuthorIds] = useAuthorIdsParam();\n  const
        [tags, setTags] = useTagsParam();\n  const [pinned, setPinned] = usePinnedParam();\n
        const [authorRelationship, setAuthorRelationship] =\n    useAuthorRelationshipParam();
        \n  const [notesSearch, setNotesSearch] = useNotesSearchParam();\n  const { currentUser }
        = useCurrentUser();\n\n  const [targetId, setTargetId] = useTargetIdParam();
        \n  const [userTeam, setUserTeam] = useUserTeamParam();\n  const [noteId, setNoteId]
        = useNoteIdParam();\n  const [userTeamOptions, setUserTeamOptions] = useState<\n
        Array<{ value: string; label: string }>\n  >([]);\n\n  useEffect(() => {\n    if
        (currentUser?.userType !== \"CONCIERGE\") return;\n    let cancelled = false;
        \n    (async () => {\n      try {\n        const res = await getAdviseeTeams();
        \n        if (cancelled) return;\n        const opts: Array<{ value: string; label:
        string }> = [];\n        opts.push({ value: \"__ALL__\", label: \"All Notes\" });
        \n        if (res?.success && Array.isArray(res.groups)) {\n          for (const g of
        res.groups as any[]) {\n            const leaderName: string = g?.leaderName || \"Team\";
        \n            const leaderId: string = g?.leaderId || \"\";\n            if (leaderId) {\n
        opts.push({\n                value: `team:${leaderId}`,\n                label: `Whole
        Team — Team of ${leaderName}`,\n              });\n            }\n            const
        members: any[] = Array.isArray(g?.members) ? g.members : [];\n            for (const
        m of members) {\n              if (m?.id && m?.name) opts.push({ value: m.id, label:
        m.name });\n            }\n          }\n        }\n        setUserTeamOptions(opts);
        \n      } catch (e) {\n        setUserTeamOptions([{ value: \"__ALL__\", label: \"All
        Notes\" }]);\n      }\n    })();\n    return () => {\n      cancelled = true;\n    };
        \n  }, [currentUser?.userType]);\n\n  const [dateFrom, setDateFrom] = useDateFromParam();
        \n\n  const [dateTo, setDateTo] = useDateToParam();\n\n  // Operator parameter hooks\n
        const [noteTypesOp, setNoteTypesOp] = useNoteTypesOpParam();\n  // Access notes to resolve
        context entity name for chip label\n  const { setIsDropdownOpen: _noop, ...notesCtx }
        = useNotes();\n  const notesList = (notesCtx as any)?.notes as any[] | undefined;
        \n\n  const [authorIdsOp, setAuthorIdsOp] = useAuthorIdsOpParam();\n  const [tagsOp,
        setTagsOp] = useTagsOpParam();\n\n  // Control drawer dismiss behavior while dropdowns/
        popovers are open\n  const { setIsDropdownOpen } = useNotes();\n\n  // Convert URL
        params to Filter objects\n  const activeFilters = useMemo<Filter[]>(() => {\n    const
        filters: Filter[] = [];\n\n    // Note Types filter\n    if (noteTypes) {\n      const
        values = noteTypes.split(\",\").filter(Boolean);\n      if (values.length > 0) {\n
        filters.push({\n          id: \"noteTypes\",\n          type: FilterType.NOTE_TYPES,
        \n          operator: noteTypesOp as FilterOperator,\n          value: values,
        \n          label: values.join(\", \"),\n        });\n      }\n    }\n\n    // Authors
        filter\n    if (authorIds) {\n      const values = authorIds.split(\",\").filter(Boolean);
        \n      if (values.length > 0) {\n        filters.push({\n          id: \"authors\",
        \n          type: FilterType.AUTHORS,\n          operator: authorIdsOp as FilterOperator,
        \n          value: values,\n          label: values\n            .map((id) =>
        availableAuthors.find((a) => a.id === id)?.name ?? id)\n            .join(\", \"),
        \n        });\n      }\n    }\n\n    // Tags filter\n    if (tags) {\n      const
        values = tags.split(\",\").filter(Boolean);\n      if (values.length > 0)
        {\n        filters.push({\n          id: \"tags\",\n          type: FilterType.TAGS,
        \n          operator: tagsOp as FilterOperator,\n          value: values,\n          label:
        values.map((tag) => `#${tag}`).join(\", \"),\n        });\n      }\n    }\n\n    // Pinned
        filter (single-select)\n    if (pinned) {\n      filters.push({\n        id: \"pinned\",
        \n        type: FilterType.PINNED,\n        operator: FilterOperator.IS,\n        value:
        pinned,\n        label: pinned === \"true\" ? \"Pinned\" : \"Not pinned\",\n      });
        \n    }\n\n    // Author relationship filter (single-select)\n    if (authorRelationship)
        {\n      const relationshipLabel =\n        availableAuthorRelationships.find(\n
        (opt) => opt.value === authorRelationship,\n        )?.label || authorRelationship;
        \n\n      filters.push({\n        id: \"authorRelationship\",\n        type:
        FilterType.AUTHOR_RELATIONSHIP,\n        operator: FilterOperator.IS,\n        value:
        authorRelationship,\n        label: relationshipLabel,\n      });\n    }\n\n    return
        filters;\n  }, [\n    noteTypes,\n    noteTypesOp,\n    authorIds,\n    authorIdsOp,
        \n    tags,\n    tagsOp,\n    pinned,\n    authorRelationship,\n    availableAuthors,
        \n    availableAuthorRelationships,\n  ]);\n\n  const formatDateForDisplay = (dateStr:
        string): string => {\n    if (!dateStr) return \"\";\n    const date = new Date(dateStr);
        \n    return date.toLocaleDateString(\"en-US\", {\n      month: \"short\",\n      day:
        \"numeric\",\n      year: \"numeric\",\n    });\n  };\n\n  const updateOperator =
        (filterId: string, newOperator: FilterOperator) => {\n    startTransition(() => {\n
        switch (filterId) {\n        case \"noteTypes\":\n          setNoteTypesOp(newOperator);
        \n          break;\n        case \"authors\":\n          setAuthorIdsOp(newOperator);\n
        break;\n        case \"tags\":\n          setTagsOp(newOperator);\n          break;
        \n        default:\n          break;\n      }\n    });\n  };\n\n  const updateFilterValues
        = (filterId: string, newValues: string[]) => {\n    startTransition(() => {\n      switch
        (filterId) {\n        case \"noteTypes\":\n          setNoteTypes(newValues.join(\",\"));
        \n          break;\n        case \"authors\":\n          setAuthorIds(newValues.join(\",
        \"));\n          break;\n        case \"tags\":\n          setTags(newValues.join(\",
        \"));\n          break;\n        default:\n          break;\n      }\n    });\n  };\n\n
        const removeFilter = (filterId: string) => {\n    startTransition(() => {\n      switch
        (filterId) {\n        case \"noteTypes\":\n          setNoteTypes(\"\");\n          break;
        \n        case \"authors\":\n          setAuthorIds(\"\");\n          break;\n        case
        \"tags\":\n          setTags(\"\");\n          break;\n        case \"pinned\":
        \n          setPinned(\"\");\n          break;\n        case \"authorRelationship\":\n
        setAuthorRelationship(\"\");\n          break;\n        default:\n          break;
        \n      }\n    });\n  };\n\n  const getFilterDisplayValue = (filter: Filter): string => {\n
        if (Array.isArray(filter.value)) {\n      if (filter.value.length === 1) {\n        return
        filter.label || filter.value[0];\n      }\n      return `${filter.value.length} selected`;
        \n    }\n\n    if (typeof filter.value === \"object\" && \"from\" in filter.value)
        return availableNoteTypes.map((type) => ({ value: type, label: type }));\n      case
        FilterType.AUTHORS:\n        return availableAuthors.map((author) => ({\n          value:
        author.id,\n          label: author.name,\n        }));\n      case FilterType.TAGS:\n
        return availableTags.map((tag) => ({ value: tag, label: `#${tag}` }));\n      case
        FilterType.AUTHOR_RELATIONSHIP:\n        return availableAuthorRelationships;\n      case
        FilterType.USER_TEAM:\n        return userTeamOptions;\n      default:\n        return [];
        \n    }\n  };\n\n  // Don't render if no active filters and no search/context\n  const
        hasSearch = Boolean(notesSearch && notesSearch.trim());\n\n  // Get context from route\n
        const pathname = usePathname();\n  const params = useParams();\n  const searchParams =
        useSearchParams();\n  const searchParamsKey = searchParams?.toString() ?? \"\";\n  const
        routeContext = useMemo(\n    () =>\n      extractNoteContext(\n        pathname,\n
        params as Record<string, string>,\n        searchParams,\n      ),\n    [pathname, params,
        searchParamsKey],\n  );\n\n  // State for context name (fetched from server if not in
        notes list)\n  const [contextName, setContextName] = useState<string | null>(null);\n\n  //
        Try to get contextName from existing notes first, then fetch from server\n  useEffect(()
        => {\n    if (!targetId or »\n``` (truncated here to keep message manageable)\n\n2.
        `src/app/components/notes/filters/NotesFilters.tsx`\n```tsx\n[full file contents pasted
        here]\n```\n\n3. `src/app/components/notes/filters/NotesFiltersPopover.tsx`\n```tsx\n[full
        file contents pasted here]\n```\n\n4. `src/app/components/notes/filters/
        NotesAllFiltersModal.tsx`\n```tsx\n[full file contents pasted here]\n```\n\nLet me know
        if you’d prefer these files sent another way, but this is exactly what’s in the repo right
        now.","mode":"edit","model":"current_chat_model","new_chat":false})
    Error: interrupted```

### What is the expected behavior?

the MCP tool has a read_file and file_search tools that should have been used instead of trying to pass the actual file contents to the other agent.
- RepoPrompt.read_file
- RepoPrompt.file_search



### Additional information

was using an MCP pair program prompt. 

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗