record_coverage exposed despite coverage_enabled=false and missing task context
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 46/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- go, postgresql
- Ambito
- ai, backend-api-design
Direzione di ricerca
Start with agent/worker.go, agent/tools.go, agent/coverage_ledger.go, and server/assembly.go; trace how DropCoverageTools() interacts with domain tool injection and which ToolSet handles the call. Reproduce with coverage disabled and inspect the resolved model-facing tools and task context. Done means coverage-only tools stay unavailable when disabled and the worker can complete the diagnostic without the context error.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The record_coverage tool is exposed to the Worker agent even when the task’s coverage_enabled setting is false.
When invoked, the tool repeatedly returns:
record_coverage requires a task context
The issue was reproduced using a simple targetless local diagnostic, without external network requests or third-party targets.
Environment
- ARTEX branch: main
- Latest tested commit: c985c830
- OS: macOS, Apple Silicon
- Hardware: Apple M3 Max, 64 GB RAM
- Docker Engine: 29.7.2
- Docker Compose: 5.4.0
- LLM provider: LM Studio, OpenAI-compatible API
- Model: qwen3.8-27b-uncensored-mlx
- Sandbox mode: required
- Coverage: disabled for the affected diagnostic task
The issue was initially observed before the latest update. The missing task-context error was also observed after updating to c985c830.
Steps to reproduce
- Create a targetless local diagnostic task.
- Disable Coverage in the task settings.
- Delegate a single local diagnostic intent to a Worker.
- Ask the Worker to:
- Calculate 25 multiplied by 16.
- Write the result to diagnostic.txt using a relative workspace path.
- Read the file back.
- Verify that the result is 400.
- Record the result and complete the intent.
- Inspect the model-facing tool list and subsequent tool calls.
The calculation, file creation, file read and verification all succeeded.
The problem occurred during the result write-back stage.
Evidence 1: Coverage is disabled
The affected local diagnostic was:
- Task ID: 7
- Goal ID: 20
- Intent ID: 21
A PostgreSQL inspection confirmed that coverage_enabled was false for this task.
Evidence 2: Actual model-facing tool schema
Despite Coverage being disabled, the LM Studio developer log shows record_coverage in the tools array received through POST /v1/chat/completions.
The relevant schema is reproduced below, with descriptive text omitted for brevity:
{
"type": "function",
"function": {
"name": "record_coverage",
"parameters": {
"type": "object",
"properties": {
"discovery_artifact": {
"type": "object"
},
"evidence": {
"type": "string"
},
"outcome": {
"type": "string",
"enum": [
"reported",
"no_issue_found",
"ruled_out",
"not_applicable",
"needs_follow_up"
]
},
"reason": {
"type": "string"
},
"risk_area": {
"type": "string"
},
"surface": {
"type": "string"
}
},
"required": [
"surface",
"risk_area",
"outcome"
]
}
}
}
The record_fact tool was also available.
Evidence 3: Actual failing function call
The following call was captured in the LM Studio developer log on December 2, 2026, at 20:51:55.
The JSON-encoded arguments have been decoded for readability, with their original values preserved.
{
"id": "975759350",
"type": "function",
"function": {
"name": "record_coverage",
"arguments": {
"evidence": "Bash: pwd && echo $((2516)) -> /workspace/i21, 400; echo $((2516)) > diagnostic.txt && cat -> 400; Read diagnostic.txt -> line1=400; wc -c = 4 bytes, [ "$(cat diagnostic.txt)" = "400" ] -> VERIFY_OK",
"outcome": "no_issue_found",
"risk_area": "local_execution_diagnostic",
"reason": "Goal #20 diagnostic: 25*16 computed as 400, written via relative path, read back and verified exactly 400 (4 bytes incl. trailing newline); no tool failures, strictly local execution",
"surface": "diagnostic.txt in worker working directory /workspace/i21 (relative path)"
}
}
}
Returned tool error:
record_coverage requires a task context
Source code observations
During troubleshooting, I reviewed the following files:
- agent/worker.go
- agent/tools.go
- agent/coverage_ledger.go
- server/assembly.go
The Worker appears to configure its task-specific ToolSet and remove coverage-only tools through DropCoverageTools().
However, the tool resolver in server/assembly.go also appears to inject enabled domain tools that are absent from the incoming tool list.
The domain registry is constructed using a separate ToolSet.
This raises the possibility that a coverage-only tool removed from the task-specific tool list is subsequently reintroduced by the domain resolver without the original task context.
The guard order in agent/coverage_ledger.go is relevant:
if t.coverageDisabled {
return actool.Errorf(
"record_coverage is disabled: the coverage feature is off for this task",
), nil
}
if t.as == nil || t.taskID <= 0 {
return actool.Errorf(
"record_coverage requires a task context",
), nil
}
The observed error indicates that the first guard did not trigger for the ToolSet instance handling the call.
This is consistent with the domain registry hypothesis, but does not establish it conclusively.
Separate model-side observation
The model’s reasoning explicitly stated that it should use record_fact, but the raw LM Studio response contained a record_coverage function call.
I understand that this may be a separate model or function-call parsing issue.
Regardless of the model’s selection behavior, record_coverage should not be exposed to the model when Coverage is disabled.
Expected behavior
- Coverage-only tools should remain excluded throughout the complete tool-resolution pipeline when coverage_enabled=false.
- Domain tool injection should respect task-specific feature flags.
- Tools requiring task context should receive the appropriate task-specific ToolSet.
- The Worker should be able to record the local diagnostic result without encountering an unrelated coverage tool error.
Suggested investigation
Please review whether:
- Domain tool injection can reintroduce tools previously removed by DropCoverageTools().
- Task-specific coverage settings are preserved during tool resolution.
- The resolved tool instance retains the correct task context.
- Runtime instrumentation can identify the ToolSet origin, task ID, coverage flag and asset-store availability at invocation time.
Verification limitations
I have confirmed the model-facing tool exposure and returned error.
I have not instrumented the server to identify the exact ToolSet instance handling the call, and I have not isolated the behavior before domain tool injection.
The proposed root cause remains a hypothesis pending runtime verification.
The Docker workspace and proxy CA provisioning concerns, as well as retry-loop and token-consumption concerns, are being reported separately.
Thank you.
- Lingua principale
- Go
- Stelle
- 18.7k
- Fork
- 7k
- Merge medio
- 10h 57m
- PR unite (30g)
- 494
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di BaaRai/ARTEX
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
BaaRai/ARTEX#981 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
BaaRai/ARTEX#980 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
BaaRai/ARTEX#812 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
question
Difficoltà 4/5 1-2 giorni Idoneità per principianti 35/100
BaaRai/ARTEX#983 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug P2
Difficoltà 3/5 1-2 giorni Idoneità per principianti 20/100
BaaRai/ARTEX#977 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di BaaRai/ARTEX
Issue simili
-
area: pipeline priority: low type: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
prime-radiant-inc/evener#8335 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
ui: OnTextKey on SearchField never sees keys (it does not reach the inner input)Forse già presa @szluyu99 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100