Skip to content

quota limit reached message implemented - #65

Open
Edenbel27 wants to merge 137 commits into
iCog-Labs-Dev:dev/bug-fixfrom
Edenbel27:feat/provider
Open

Edenbel27 wants to merge 137 commits into
iCog-Labs-Dev:dev/bug-fixfrom
Edenbel27:feat/provider

Conversation

@Edenbel27

Copy link
Copy Markdown

When the configured LLM provider's API quota or billing limit is reached, the agent was silently failing, returning empty responses every loop iteration with no feedback to the user. This fix detects quota/billing exhaustion errors across all supported LLM providers and sends a one-time notification to the user through the active communication channel (Telegram, Slack, IRC, Mattermost, etc.).

Changes made:

  • Added LLMQuotaExceededError exception and _is_quota_error() helper in
    lib_llm_ext.py to detect quota errors from any provider using known error signal strings
  • Updated openai.py and asione.py to raise LLMQuotaExceededError instead of silently returning ""
  • Updated providers.py to catch LLMQuotaExceededError, send a one-time user notification via the active channel, and continue running.
  • A deduplication set prevents repeated messages for the same error; it clears on the next successful LLM response
  • I have tested it by using open ai and anthropic api keys that has no credits and by different channels like telegram and slack.

surafelfikru and others added 30 commits March 27, 2026 00:36
This was implemented in main and this commit is syncing the telgram
implementations of last_message with main
Implemented telegram security/capability matrix
Also made the function configurable through CLI input
Load BOT_TOKEN/CHAT_ID from .env via dotenv instead of passing through
metta config. Refactor channel selection from case to if chains.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add prompt-configure that asks for each setting interactively with
defaults shown. CLI args (name=value) still override and skip the prompt.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
blackhammer116 and others added 29 commits July 1, 2026 12:04
Added frame composition and frame management skills
…rameRef indexspace removal

- cfv2-load-frame: add sread normalisation guard as first let* binding to
  strip quotes from Grounded frame ID atoms passed by the LLM (e.g. Frame-...)
  so cfv2-get-frame pattern match no longer silently returns ()

- cfv2-make-frame-ref-from-current: fix status field destructuring to use
  (status ) so the named field is correctly re-wrapped in FrameRef
  output; fix debug println to reference  instead of '

- add cfv2-check-ref-id and cfv2-remove-frame-ref to correctly match and
  remove FrameRef atoms from frame-indexspace (cfv2-remove-frame only matches
  Frame atoms and was silently failing on the indexspace)

- use cfv2-remove-frame-ref in cfv2-complete-current-frame-to-stm/ltm to
  correctly clean up frame-indexspace on frame completion
Replace flat 2-branch  signal with 4 distinct cases driven
by  and frame state:

- Case 1: new input, no prior active frame — clean start signal
- Case 2: new input, prior frame was active — switch-frame hint signal
- Case 3: no new input, frame loaded — continue or idle signal
- Case 4: no new input, no frame — autonomous goal hint signal

Add  binding captured before ctx-ingest-user-message to
correctly distinguish Case 1 from Case 2 — after ingestion a new frame
is always present making the two cases indistinguishable at prompt time.

Legacy useFrames=False path preserved with original DO NOT RE-SEND OR SPAM! signal.
- replace cfv2-check-ref-id and cfv2-remove-frame-ref with a second
  cfv2-check-frame-id clause that pattern-matches FrameRef, allowing
  cfv2-remove-frame to handle both Frame and FrameRef spaces uniformly

- update cfv2-remove-frame comment to reflect it now dispatches on
  both Frame and FrameRef via cfv2-check-frame-id

- fix swapped case comments in loop.metta  block to match
  actual branch order of the if expression

- remove unnecessary comment above  binding
…rame

fix(context): frame ID normalisation, FrameRef fixes and 4-case loop signal
…ew modifications on the context frame skills description
With context frames the received message is no longer passed after the
":-:-:-:" delimiter, so the mock never found a registered answer and every
test that drives the agent failed.

- match the request against the CURRENT_CONTEXT_FRAME_S_EXPR section when
  the delimiter carries a loop signal, keeping the HUMAN-MSG path first so
  the suite still runs on core main
- serve an answer once per frame and complete the frame afterwards, so an
  unfinished frame does not keep later messages from becoming current
- let a test keep the frame open with set_answer(..., complete_frame=False)
- drop registered answers between tests
Disable Chroma's default embedding function because frame relations provide
their own embeddings, and skip similarity queries when no other frames exist.
Remove duplicate frame-completion operations from skills.metta so the canonical
implementations in context.metta are invoked only once.
Frame completion mutates memory and frame spaces but stays a
nondeterministic call, while the command dispatcher evaluates commands
under collapse. Every retry re-executed the whole chain with its side
effects, each pass produced a different result, and the agent never
returned. Wrap the three completion commands in once.

balance_parentheses split an answer by lines and then stripped the outer
parens of the whole block. An answer whose first form takes no arguments
was corrupted: the command name kept its closing paren and the remaining
form became a string, so the agent reported a syntax error and ran none
of the commands. Split a block into top-level forms first, ignoring
parens inside string literals.
…-mock

[OMEGA-286] Match mock answers against the context frame
…-completion-loop

[OMEGA-286] Fix frame completion loop and multi-form answer parsing
@Edenbel27
Edenbel27 changed the base branch from main to dev/bug-fix August 19, 2026 08:18
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.

5 participants