Worker sandbox issues: missing task context in record_coverage, incorrect workspace paths, and inaccessible proxy CA certificate

Open
#891 5 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker, docker-compose, go, postgresql

Research direction

Start by tracing tool construction and injection across agent/worker.go, agent/tools.go, agent/coverage_ledger.go, and server/assembly.go, then follow workspace and CA certificate paths through the Docker Compose runner and worker configuration. Reproduce the targetless diagnostic described in the issue with coverage disabled and inspect worker instructions and tool availability. Done means the reported task context, shared workspace, sandbox-local paths, and CA access failures are addressed and the worker reports incomplete checks without looping.

Written by the indexing model from the issue text.

Description

Bug report

I have spent several hours troubleshooting ARTEX on macOS with Docker Desktop and a local LM Studio instance. Despite updating to the latest available commit, several issues persist and prevent reliable task execution.

  1. Environment
  • ARTEX commit: c985c830
  • Previous commit: 048e8a84
  • Branch: main
  • Host: macOS, Apple Silicon 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
  • Model context length: 65,536 tokens
  • Parallel predictions: 3
  • ARTEX workers: 3
  • Sandbox mode: required
  • Deployment: Docker Compose with the Docker Desktop overlay

The backend, PostgreSQL and runner are operational. The executor isolation self-test passes successfully.

  1. Issue: record_coverage requires a task context

Workers repeatedly call record_coverage, which consistently returns:

record_coverage requires a task context

The model acknowledges the failure and states that it will use record_fact instead, but repeatedly calls record_coverage again.

This results in excessive token consumption, repeated failed tool calls and eventual worker timeouts.

The issue also occurred in a strictly local, targetless diagnostic task with Coverage Enabled explicitly disabled. I verified directly in PostgreSQL that coverage_enabled was correctly stored as false.

Suspected root cause

After reviewing the source code, I suspect an issue in the interaction between the per-task ToolSet and the server-level domain tool injection mechanism.

Relevant files:

  • agent/worker.go
  • agent/tools.go
  • agent/coverage_ledger.go
  • server/assembly.go

In agent/worker.go, coverage tools are filtered through:

tsx.DropCoverageTools(tsx.WorkerTools())

However, the resolver in server/assembly.go can subsequently inject domain tools that are absent from the incoming tool list.

The server-level registry is constructed using:

serverTS := agent.NewToolSet(nil, "")
serverTS.SetAssetStore(as, as.Companies())

These tool instances are task-less by construction.

It appears possible that record_coverage is correctly removed from the task-specific tool list but subsequently reintroduced through domainReg as a task-less instance.

This would explain both the availability of the tool when coverage is disabled and the missing task context error.

This is a suspected root cause, not a verified source-level fix.

  1. Issue: Docker Desktop workspace inconsistency

The Docker Desktop overlay uses a named volume for the ARTEX application data:

artex_data -> /app/data

However, the runner originally used host bind mounts for:

./data/tasks -> /app/data/tasks

Consequently, the backend created task directories inside the named volume, while worker containers received a different, empty host directory.

The original error was:

OCI runtime exec failed:
chdir to cwd ("/workspace/i15") set in config.json failed:
no such file or directory

I implemented a local Compose override to make the runner and worker use the same underlying task storage.

After this change, a local diagnostic successfully executed Bash, created a file inside the assigned worker workspace, and read it back. The backend could also access the same file.

However, the default Docker Desktop deployment appears to require further investigation to ensure consistent workspace storage across the backend, runner and worker containers.

  1. Issue: incorrect workspace paths in worker instructions

Even after resolving the storage inconsistency, workers frequently attempt to use backend filesystem paths such as:

/app/data/tasks/8/i26

instead of their actual sandbox working directory:

/workspace/i26

This produces errors such as:

bash: cd: /app/data/tasks/8/i26:
No such file or directory

and:

mkdir: cannot create directory '/app':
Read-only file system

The read-only filesystem protection is working correctly. The problem appears to be that worker instructions expose or encourage the use of paths that belong to the backend container rather than the worker sandbox.

Workers should receive workspace paths appropriate to their actual execution environment.

  1. Issue: proxy CA certificate inaccessible inside worker sandbox

HTTPS requests from workers also fail with:

curl: (77) error setting certificate file:
/app/data/traffic/_ca/mitmproxy-ca-cert.pem

The configured CA certificate path appears to reference the backend container filesystem and is not accessible from the worker sandbox.

Please investigate whether the proxy CA certificate is correctly provisioned inside worker containers and whether the corresponding environment variables reference a valid sandbox-local path.

TLS verification and sandbox isolation should remain enabled.

  1. Excessive token consumption and failed-tool retry loops

During one task, ARTEX consumed approximately:

  • Input tokens: 1.6 million
  • Output tokens: 126,600
  • LLM calls: 95
  • Reported cache hit rate: 0%

Despite this consumption, the task remained incomplete.

Several workers spent substantial time repeating failed tool calls rather than terminating or reporting incomplete checks.

I would also appreciate investigation into:

  • Repeated identical failed tool calls
  • Worker termination and write-back behavior
  • Task-context preservation during termination
  • Prompt/context growth and cache utilization
  • Timeout handling when workers cannot make progress
  1. Steps to reproduce the task-context issue

The issue can be reproduced without accessing any external target.

  1. Deploy ARTEX on macOS using Docker Desktop.
  2. Configure LM Studio as the LLM provider.
  3. Create a targetless local diagnostic task.
  4. Disable Coverage Enabled.
  5. Ask the planner to delegate a single worker intent that calculates 25 * 16, writes the result to a relative workspace file, reads it back, and completes the task.
  6. Observe the worker’s write-back and termination behavior.

In my environment, the local file operation succeeded, but the worker repeatedly attempted to call record_coverage and received the missing task context error.

I also tested basic tool selection directly through the LM Studio API. The model correctly selected record_fact when explicitly requested, so basic function calling works outside ARTEX.

  1. Expected behavior
  • Coverage-disabled tasks must not receive coverage-only tools.
  • Task-specific tools must retain their task context.
  • Backend and runner must share consistent task storage on Docker Desktop.
  • Workers must receive valid sandbox-local workspace paths.
  • Proxy CA certificates must be accessible inside the sandbox without disabling TLS verification.
  • Repeated identical tool failures should terminate gracefully instead of consuming tokens indefinitely.
  • Incomplete checks must be reported accurately without being marked as successfully completed.
  1. Current status

All of these issues were observed during troubleshooting. The record_coverage failure was reproduced again after updating to commit c985c830.

I would appreciate guidance on whether these are known issues, configuration problems, or implementation bugs.

Is there a recommended stable release or supported Docker Desktop configuration that addresses these problems?

Thank you.

Dominant language
Go
Stars
18.7k
Forks
7k
Avg merge
10h 57m
Merged PRs (30d)
494

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BaaRai/ARTEX

All issues in BaaRai/ARTEX

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.