The Deska blog
Agents in a Repo With No Tests
Learn how to safely deploy AI agents in a repo with no tests using sandbox environments and visual monitoring tools like Deska.
11 min read
Deploying autonomous agents in a repo with no tests creates a unique set of challenges for any software engineer. Without a safety net of unit or integration tests, an AI agent might introduce regressions that go unnoticed until they reach production. However, modern development workflows and specialized workspaces can mitigate these risks by providing better visibility and manual verification loops.
The Risk Profile of Untested Codebases
When you introduce agents in a repo with no tests, you are essentially asking a model to perform surgery in the dark. Standard CI/CD pipelines rely on test suites to gatekeep changes. In a legacy environment, that gate is missing.
The primary risks include:
- Logic regressions where the agent fixes one bug but breaks three existing features.
- Dependency drift if the agent updates packages without verifying compatibility.
- Infinite loops or resource exhaustion in scripts that lack boundary checks.
- Hallucinated library calls that pass a linter but fail at runtime.
Navigating these risks requires a shift from "automate and forget" to "orchestrate and observe." You cannot trust the agent to validate its own work through traditional means if the infrastructure for validation does not exist.
Establishing a Manual Safety Net
Before running Claude Code or OpenCode on an untested repository, you must establish a baseline. If you cannot automate the tests, you must maximize your ability to inspect the agent in real time.
One approach is to use a local-first environment where the agent's actions are immediately visible on your file system. Instead of running agents in a remote, headless container, running them locally allows you to use your existing debugger and environment variables to catch errors as they happen.
Strategy 1: Characterization Tests
If the repo lacks tests, the agent's first task should be to write them. This is often called a "Golden Master" or characterization test. You instruct the agent to record the current output of a function for a given input. Even if the output is currently wrong, recording it ensures that the agent does not change the behavior unexpectedly during refactoring.
Strategy 2: Visual Monitoring
Traditional IDEs often hide the agent's terminal or background processes. Using a tool like Deska allows you to place multiple coding agents side by side in an infinite canvas. You can have one panel running the agent, another showing a live tail -f of the logs, and a third with the browser showing the application frontend. This spatial arrangement makes it easier to spot visual glitches or log errors that the agent might ignore.
Comparing Agent Workflows
Different agents have different strengths when dealing with legacy, untested code.
| Agent | Approach | Best For |
|---|---|---|
| Claude Code | High reasoning and CLI integration | Complex refactoring and logic fixes |
| Codex CLI | Direct command execution | Small, targeted script updates |
| OpenCode | Open weight flexibility | General assistance and documentation |
These tools differ in approach. Claude Code tends to be more cautious, often explaining its plan before execution. OpenCode may be more aggressive. Running them side by side in a unified workspace allows you to compare their proposed solutions before committing any code to your branch.
Using Deska for Untested Repositories
Deska is a free desktop app for Mac, Windows, and Linux designed to handle complex agentic workflows. It provides an infinite canvas where you can organize your thoughts and your tools. When working with agents in a repo with no tests, visibility is your only defense.
The Power of the Canvas
In Deska, you are not limited to a single tab. You can place panels anywhere. For an untested repo, a typical layout might include:
- A terminal panel running the agent.
- A Monaco-based editor showing the specific file being modified.
- A notes panel where you keep a checklist of manual verification steps.
- The Ask Deska assistant to help move panels or run system-level commands.
Mobile Monitoring
If you are running a long refactoring task, you might need to step away from your desk. The mobile app allows you to monitor the progress through a secure relay. Because the devices pair directly and no ports are exposed, you maintain the security of your local-first environment while staying informed of any crashes or errors the agent encounters.
Best Practices for Agentic Refactoring
- Work in small increments. Never let an agent refactor more than one function at a time.
- Commit frequently. Use Git as your undo button since you lack a test suite.
- Use the terminal to run the code after every change. If the agent does not do this automatically, you must do it manually.
- Verify through a browser panel if the code affects the UI.
- Leverage voice commands to quickly toggle between different parts of the workspace when your hands are busy debugging.
The goal is to move the repository from a state of "no tests" to "basic test coverage" using the agent as a tool, not a replacement for your judgment.
FAQ
How to run AI agents safely?
The safest way to run agents is in a local-first environment with strict version control. Always review the diffs provided by the agent before accepting them. Using an infinite canvas like Deska helps you keep all logs and editors visible, reducing the chance of missing a critical error.
Can AI agents write tests for legacy code?
Yes, AI agents are particularly good at writing boilerplate and unit tests. For legacy code, instruct the agent to write characterization tests that capture current behavior before attempting to improve the code. This provides a baseline for future changes.
What is the best workspace for AI coding?
The best workspace is one that stays out of your way and provides maximum visibility. Deska offers an infinite canvas where you can run multiple agents like Claude Code and Codex CLI side by side while maintaining local-first security for your files and API keys.
Conclusion
Working with agents in a repo with no tests is a high-wire act, but it is also one of the most productive ways to modernize a codebase. By focusing on visibility, incremental changes, and specialized workspaces, you can turn a risky legacy project into a maintainable one.
If you are ready to organize your AI development workflow with a flexible, local-first canvas, you can download Deska today for free.