[bug] Infographic generation fails when prompt exceeds the local model context

Abierto
#2,421 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@MODSetter ya está trabajando en esto.

Desde el 8/11/2026.

  • #2422 de @MODSetter — abierto

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
ai, backend

Línea de trabajo

Start with worker/studio/media/visual/infographic/pipeline.py at the reported render call, then trace how prompts and source excerpts are passed to generate.run_model and how model errors are classified and retried. The issue calls for token budgeting, source reduction with attribution, and clear handling of context overflow; done means oversized requests do not repeat unchanged and users receive a specific context-limit error.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug
Which part?

Desktop app

What happened?

Generating an Infographic from two selected sources fails after approximately two minutes.

The Studio worker gathers 24,000 source characters and sends a request larger than the configured 8,192-token context window:

request (8545 tokens) exceeds the available context size (8192 tokens)

SurfSense reports:
Infographic failed: This artifact couldn’t be generated.

The model is running and reachable. The failure occurs because the Infographic pipeline submits more tokens than the model context supports.

The failed task is also requeued without reducing the source content or token budget, causing another identical failure and unnecessary model loading.

What did you expect?

The Infographic pipeline should calculate the full token budget before submitting the request.

The budget should account for:

system and Infographic prompts
selected source excerpts
chat-template overhead
reserved output tokens
reasoning tokens
multimodal tokens, when applicable
a safety margin
If the request is too large, SurfSense should automatically reduce or summarize the selected source content while preserving source attribution.

A deterministic context-overflow failure should not be retried with the same payload.

The application should display a specific message such as:

"The selected sources exceed the model context limit. Reduce the sources or retry with automatic summarization."

It should not report the problem as "The model could not be reached," because the model was available and explicitly rejected an oversized request.

How to reproduce

SurfSense 2.3.1
Windows 10.0.26300 x64
Electron 44.10.1
Chromium 152.0.7977.169
Node 24.22.1
 
studio: artifact 3 format=infographic starting
studio: artifact 3 gathered 2 sources (24000 chars)
 
llama-server:
--ctx-size 8192
--fit-ctx 8192
--parallel 4
 
E srv send_error: task id = 3, error:
request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
studio: artifact 3 failed after 155.8s:
The model could not be reached: request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
worker/studio/media/visual/infographic/pipeline.py, line 45, in render
generate.run_model(writer, prompt(writer.tier, user_prompt), sources)
 
httpx.HTTPStatusError:
request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
Unhandled exception in task de9b89d0-4ce3-4e8b-b76d-7ed3db7c3c39
Requeueing de9b89d0-4ce3-4e8b-b76d-7ed3db7c3c39, 0 retries
 
After retry:
studio: artifact 3 gathered 2 sources (24000 chars)
 
E srv send_error:
request (8459 tokens) exceeds the available context size (8192 tokens), try increasing it
 
Error: Infographic failed:
This artifact couldn’t be generated. Retry it from the artifacts tab.

Logs
SurfSense 2.3.1
Windows 10.0.26300 x64
Electron 44.10.1
Chromium 152.0.7977.169
Node 24.22.1
 
studio: artifact 3 format=infographic starting
studio: artifact 3 gathered 2 sources (24000 chars)
 
llama-server configuration:
--ctx-size 8192
--fit-ctx 8192
--parallel 4
 
E srv send_error: task id = 3, error:
request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
studio: artifact 3 failed after 155.8s:
The model could not be reached: request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
worker/studio/media/visual/infographic/pipeline.py, line 45, in render
generate.run_model(writer, prompt(writer.tier, user_prompt), sources)
 
httpx.HTTPStatusError:
request (8545 tokens) exceeds the available context size (8192 tokens), try increasing it
 
Unhandled exception in task de9b89d0-4ce3-4e8b-b76d-7ed3db7c3c39
Requeueing de9b89d0-4ce3-4e8b-b76d-7ed3db7c3c39, 0 retries
 
After retry:
studio: artifact 3 gathered 2 sources (24000 chars)
 
E srv send_error:
request (8459 tokens) exceeds the available context size (8192 tokens), try increasing it
 
Error: Infographic failed:
This artifact couldn’t be generated. Retry it from the artifacts tab.
Lenguaje dominante
Python
Estrellas
16.3k
Forks
1.6k
Merge medio
11 h 15 min
PR fusionados (30 d)
167

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de MODSetter/SurfSense

Todos los issues de MODSetter/SurfSense

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.