Skip to content

Commit 76062fe

Browse files
Codegassclaude
andcommitted
Merge origin/ui: integrate website, banner, and metadata-aware CLI
Resolves divergence (2 local / 14 remote commits) on the ui branch by merging origin/ui. Remote contributed the project_meta.json flow, URL-based project-name extraction, the public website, and architecture banner. Local contributed the UI-mode console suppression. Conflict resolution in main.py: kept remote helpers and variable usage (local versions referenced undefined `project_name` in scope and used the `name` click option which can be None), then re-applied local's intent by wrapping the `run` command's task-info prints in `if not config.ui_mode`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 parents ed747ca + ae219a7 commit 76062fe

14 files changed

Lines changed: 3750 additions & 142 deletions

File tree

.github/workflows/pages.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy website to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [ui]
6+
paths:
7+
- 'website/**'
8+
- '.github/workflows/pages.yml'
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
20+
jobs:
21+
deploy:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/configure-pages@v5
29+
- uses: actions/upload-pages-artifact@v3
30+
with:
31+
path: ./website
32+
- id: deployment
33+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,6 @@ student_tasks/
170170
docs/bash_tool_enhancements.md
171171

172172
plan/
173-
docs/
173+
docs/
174+
175+
website/node_modules

README.md

Lines changed: 155 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33

44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
55

6+
> ICSE-NIER ’26 paper: [Setup AGent (SAG)](https://doi.org/10.1145/3786582.3786818) — Wei et al. The paper will be available soon this April.
7+
8+
9+
610
**SAG (Setup-Agent)** is an advanced AI agent designed to fully automate the initial setup, configuration, and ongoing tasks for any software project. It operates within an isolated Docker environment, intelligently interacting with project files, shell commands, and web resources to transform hours—or even days—of manual setup into a process that takes just a few minutes.
711

812
## 🔦 Highlights
@@ -186,10 +190,95 @@ uv run sag shell sag-fastapi
186190
uv run sag remove sag-fastapi
187191
```
188192

193+
### 4. Debugging & Troubleshooting
194+
195+
When a setup fails or you want to understand what the agent did, SAG provides several debugging tools:
196+
197+
#### Enable Verbose Mode & Recording
198+
199+
```bash
200+
# Run with verbose output for detailed logs
201+
uv run sag --verbose project https://github.com/example/repo.git
202+
203+
# Save artifacts locally for post-run inspection
204+
uv run sag project https://github.com/example/repo.git --record
205+
206+
# Combine both for maximum visibility
207+
uv run sag --verbose project https://github.com/example/repo.git --record
208+
```
209+
210+
#### Inspect Container Context Files
211+
212+
The agent stores execution context inside the container under `/workspace/.setup_agent/`:
213+
214+
```bash
215+
# List all context files
216+
docker exec sag-<project> ls -la /workspace/.setup_agent/contexts/
217+
218+
# Read the trunk context (main task list and overall status)
219+
docker exec sag-<project> cat /workspace/.setup_agent/contexts/trunk_*.json | python3 -m json.tool
220+
221+
# Check specific task contexts for detailed execution history
222+
docker exec sag-<project> cat /workspace/.setup_agent/contexts/task_*.json | python3 -m json.tool
223+
224+
# Search for errors across all context files
225+
docker exec sag-<project> grep -r "error\|failed\|ERROR" /workspace/.setup_agent/contexts/
226+
```
227+
228+
#### Review Setup Reports
229+
230+
```bash
231+
# List generated reports
232+
docker exec sag-<project> ls -la /workspace/setup-report-*.md
233+
234+
# Read the setup report
235+
docker exec sag-<project> cat /workspace/setup-report-*.md
236+
```
237+
238+
#### Check Session Logs (with --record)
239+
240+
When using `--record`, artifacts are saved to local session logs:
241+
242+
```bash
243+
# Find the session log directory
244+
ls -la logs/session_*/
245+
246+
# Review the main session log
247+
cat logs/session_<timestamp>/main.log
248+
249+
# Check for specific error patterns
250+
grep -r "BUILD FAILURE\|compilation error" logs/session_<timestamp>/
251+
```
252+
253+
#### Common Debugging Scenarios
254+
255+
| Scenario | What to Check |
256+
|---|---|
257+
| Build failed | `grep "BUILD FAILURE" /workspace/.setup_agent/contexts/*.json` |
258+
| Java version mismatch | `docker exec sag-<project> java -version` and check for `RequireJavaVersion` in logs |
259+
| Missing dependencies | `docker exec sag-<project> which mvn npm gradle` |
260+
| Empty tool outputs | Check if stderr is captured in context files |
261+
| Agent stuck in loop | Review trunk context TODO list for repetitive patterns |
262+
263+
#### Interactive Debugging
264+
265+
```bash
266+
# Connect to the container shell for manual investigation
267+
uv run sag shell sag-<project>
268+
269+
# Inside the container, you can:
270+
# - Run build commands manually
271+
# - Check environment variables
272+
# - Inspect project files
273+
# - Review logs in /workspace/.setup_agent/
274+
```
275+
189276
## 🛠️ CLI Command Reference
190277

191278
SAG provides a clean and powerful set of CLI commands.
192279

280+
### Commands
281+
193282
| Command | Description | Example |
194283
|---|---|---|
195284
| `sag project <url>` | Initializes the setup for a new project from a Git repository URL. | `sag project https://github.com/pallets/flask.git` |
@@ -200,9 +289,54 @@ SAG provides a clean and powerful set of CLI commands.
200289
| `sag version` | Displays SAG's version information. | `sag version` |
201290
| `sag --help` | Shows the help message. | `sag --help` |
202291

203-
**Global Options:**
204-
- `--log-level [DEBUG|INFO|...]`: Overrides the log level set in the `.env` file.
205-
- `--log-file <path>`: Specifies a custom path for the log file.
292+
### Global Options
293+
294+
| Option | Description |
295+
|---|---|
296+
| `--log-level [DEBUG\|INFO\|WARNING\|ERROR]` | Overrides the log level set in the `.env` file. |
297+
| `--log-file <path>` | Specifies a custom path for the log file. |
298+
| `--verbose` | Enable verbose debugging output with detailed logs. |
299+
300+
### Command-Specific Options
301+
302+
#### `sag project <url>`
303+
304+
| Option | Description |
305+
|---|---|
306+
| `--name <name>` | Override the Docker container name (default: extracted from URL). **Note:** This only affects the Docker container/volume naming (`sag-<name>`), not the project directory name. The cloned repository will always use the directory name from the URL. |
307+
| `--goal <goal>` | Custom setup goal (default: auto-generated based on project name). |
308+
| `--record` | Save setup artifacts (contexts, reports) to local session logs for debugging and auditing. |
309+
310+
**Example with custom Docker name:**
311+
```bash
312+
# Clone commons-cli but name the Docker container "cli-test"
313+
sag project https://github.com/apache/commons-cli.git --name cli-test
314+
315+
# Result:
316+
# - Docker container: sag-cli-test
317+
# - Project directory: /workspace/commons-cli (always matches git repo name)
318+
# - To run tasks later: sag run sag-cli-test --task "..."
319+
```
320+
321+
#### `sag run <name>`
322+
323+
| Option | Description |
324+
|---|---|
325+
| `--task <description>` | **(Required)** The task or requirement for the agent to execute. |
326+
| `--max-iterations <n>` | Maximum number of agent iterations (overrides `SAG_MAX_ITERATIONS` from config). |
327+
| `--record` | Save setup artifacts (contexts, reports) to local session logs for debugging and auditing. |
328+
329+
#### `sag shell <name>`
330+
331+
| Option | Description |
332+
|---|---|
333+
| `--shell <path>` | Shell to use in the container (default: `/bin/bash`). |
334+
335+
#### `sag remove <name>`
336+
337+
| Option | Description |
338+
|---|---|
339+
| `--force` | Force removal without confirmation prompt. |
206340

207341
## ✅ Running Tests Locally
208342

@@ -260,3 +394,21 @@ We warmly welcome contributions of all kinds! Whether it's a bug report, a featu
260394
## 📝 License
261395

262396
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
397+
398+
## Cite this work
399+
400+
BibTeX:
401+
402+
```bibtex
403+
@inproceedings{Wei2026SAG,
404+
author = {Wei, Chenhao and Zhao, Gengwu and Ye, Billy and Xiao, Lu and Li, Xinyi},
405+
title = {Setup AGent (SAG): A Dual-Model LLM Agent for Autonomous End-to-End Java Project Configuration},
406+
booktitle = {Proceedings of the 48th International Conference on Software Engineering: New Ideas and Emerging Results (ICSE-NIER '26)},
407+
year = {2026},
408+
address = {Rio de Janeiro, Brazil},
409+
publisher = {ACM},
410+
isbn = {979-8-4007-2425-1},
411+
month = apr,
412+
doi = {10.1145/3786582.3786818}
413+
}
414+
```

0 commit comments

Comments
 (0)