Skip to content

Commit 2b5ea02

Browse files
authored
Merge pull request #36 from SoundBlaster/codex/fu-p9-t2-2-stale-uvx-troubleshooting
FU-P9-T2-2 Stale `uvx` troubleshooting
2 parents 9db9f3d + 15b2081 commit 2b5ea02

12 files changed

Lines changed: 315 additions & 1 deletion

File tree

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ With Web UI dashboard (optional — adds real-time monitoring at http://localhos
7777
}
7878
```
7979

80+
If you upgrade and want to confirm the currently running dashboard process version:
81+
82+
```bash
83+
PORT=8080
84+
PID=$(lsof -tiTCP:$PORT -sTCP:LISTEN | head -n1)
85+
PY=$(ps -p "$PID" -o command= | awk '{print $1}')
86+
"$PY" -c 'import importlib.metadata as m; print(m.version("mcpbridge-wrapper"))'
87+
```
88+
89+
If needed, do a one-time refresh start:
90+
91+
```bash
92+
uvx --refresh --from 'mcpbridge-wrapper[webui]' mcpbridge-wrapper --web-ui --web-ui-port 8080
93+
```
94+
8095
Restart Cursor and you're done. For other clients or installation methods, read on.
8196

8297
### Python Environment Setup (Development)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# FU-P9-T2-2 — Add troubleshooting guidance for stale uvx cache/process versions
2+
3+
**Priority:** P1
4+
**Dependencies:** P9-T2, FU-P9-T2-1
5+
**Phase:** Phase 9 Follow-up Backlog
6+
7+
## Objective
8+
Document and validate the stale-runtime failure mode where users still run an older `uvx` environment/process after a release, resulting in unchanged behavior (for example uptime stuck at `1h 0m 0s`) even though updated packages exist.
9+
10+
## Deliverables
11+
1. Add a dedicated troubleshooting section in `docs/troubleshooting.md` for stale `uvx` cache/process diagnosis.
12+
2. Add a recovery note in `docs/cursor-setup.md` explaining one-time use of `--refresh` after releases and restart behavior.
13+
3. Add a quick runtime-version verification snippet in `README.md` for Web UI users.
14+
4. Include concrete commands to:
15+
- identify process listening on Web UI port,
16+
- inspect active runtime package version for that process,
17+
- restart with `uvx --refresh --from mcpbridge-wrapper[webui] ...`.
18+
5. Produce validation evidence in `SPECS/INPROGRESS/FU-P9-T2-2_Validation_Report.md`.
19+
20+
## Acceptance Criteria
21+
1. Troubleshooting docs include symptom/cause/fix for stale behavior after upgrade.
22+
2. Docs include explicit diagnostic commands for port/PID/version validation.
23+
3. Recovery guidance includes `uvx --refresh --from mcpbridge-wrapper[webui] ...` and restart instructions.
24+
4. Docs clearly mention multiple concurrent wrapper processes can mask upgrades.
25+
5. Validation report records local repro and confirms refreshed process resolves stale behavior.
26+
27+
## Execution Plan
28+
1. Update `docs/troubleshooting.md` with symptom, root cause, diagnosis workflow, and recovery flow.
29+
2. Update `docs/cursor-setup.md` with post-upgrade refresh guidance for `uvx` + Web UI usage.
30+
3. Update `README.md` with a concise runtime-version verification snippet.
31+
4. Run required quality gates per FLOW:
32+
- `pytest`
33+
- `ruff check src/`
34+
- `mypy src/`
35+
- `pytest --cov` (>= 90%)
36+
5. Capture outcomes and acceptance mapping in validation report.
37+
38+
---
39+
**Archived:** 2026-02-13
40+
**Verdict:** PASS
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# FU-P9-T2-2 Validation Report
2+
3+
**Task:** FU-P9-T2-2 — Add troubleshooting guidance for stale uvx cache/process versions
4+
**Date:** 2026-02-14
5+
**Verdict:** PASS
6+
7+
## Summary
8+
Implemented troubleshooting and setup documentation updates for stale `uvx` runtime/process scenarios after upgrades, including concrete diagnosis commands, explicit `--refresh` recovery path, and warning about concurrent wrapper processes masking upgrades.
9+
10+
## Deliverables Completed
11+
- Updated `docs/troubleshooting.md` with a dedicated stale-runtime section including:
12+
- symptom/cause/fix narrative,
13+
- port/PID/version diagnostics,
14+
- `uvx --refresh --from 'mcpbridge-wrapper[webui]' ...` recovery,
15+
- explicit note about multiple concurrent wrapper processes.
16+
- Updated `docs/cursor-setup.md` with a one-time `--refresh` config pattern for post-upgrade recovery.
17+
- Updated `README.md` with runtime process version verification snippet and refresh command.
18+
19+
## Acceptance Criteria Validation
20+
1. Troubleshooting docs include symptom/cause/fix for stale behavior after upgrade.
21+
- **PASS** — Added section: `"Uptime still shows 1h 0m 0s" or behavior is unchanged after upgrade` in `docs/troubleshooting.md`.
22+
2. Docs include explicit diagnostic commands for port/PID/version validation.
23+
- **PASS** — Added `lsof`, `ps`, and interpreter-based `importlib.metadata` version checks.
24+
3. Recovery guidance includes `uvx --refresh --from mcpbridge-wrapper[webui] ...` and restart instructions.
25+
- **PASS** — Added exact command and restart/reload guidance in troubleshooting and Cursor setup docs.
26+
4. Docs clearly mention multiple concurrent wrapper processes can mask upgrades.
27+
- **PASS** — Added explicit warning in troubleshooting section.
28+
5. Validation report records local repro and confirms refreshed process resolves stale behavior.
29+
- **PASS** — Local repro captured below with stale vs refreshed runtime evidence.
30+
31+
## Local Reproduction Evidence
32+
```text
33+
stale_pid=8069
34+
stale_version=0.3.2
35+
stale_uptime_samples=3600,3600
36+
refresh_pid=53176
37+
refresh_version=0.3.3
38+
refresh_uptime_samples=0.4,2.4
39+
```
40+
41+
Interpretation:
42+
- Stale listener on port 8080 remained on `0.3.2` and returned fixed uptime.
43+
- Refreshed start used `0.3.3` and returned increasing uptime.
44+
45+
## Quality Gates
46+
- `pytest`**PASS** (345 passed, 5 skipped)
47+
- `ruff check src/`**PASS**
48+
- `mypy src/`**PASS**
49+
- `pytest --cov`**PASS** (96.62% total, threshold 90%)
50+
51+
## Notes
52+
- Test runs reported non-fatal warnings about occupied local ports (`8080`/`9090`) in background Web UI thread tests; suite still passed and coverage remained above threshold.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## REVIEW REPORT — FU-P9-T2-2 stale uvx troubleshooting docs
2+
3+
**Scope:** origin/main..HEAD
4+
**Files:** 8
5+
6+
### Summary Verdict
7+
- [x] Approve
8+
- [ ] Approve with comments
9+
- [ ] Request changes
10+
- [ ] Block
11+
12+
### Critical Issues
13+
- None.
14+
15+
### Secondary Issues
16+
- None.
17+
18+
### Architectural Notes
19+
- The troubleshooting updates correctly target runtime-process diagnosis rather than package-install assumptions.
20+
- Guidance aligns with observed failure mode where older `uvx` environments continue serving active ports.
21+
22+
### Tests
23+
- Quality gates executed during EXECUTE:
24+
- `pytest` (pass)
25+
- `ruff check src/` (pass)
26+
- `mypy src/` (pass)
27+
- `pytest --cov` (pass, 96.62% >= 90%)
28+
- No source-code behavior changes; docs-only updates validated with local stale-vs-refresh repro evidence.
29+
30+
### Next Steps
31+
- FOLLOW-UP skipped: no actionable review findings.

SPECS/ARCHIVE/INDEX.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
| BUG-T0 | [BUG-T0_Uptime_Widget_Fix/](BUG-T0_Uptime_Widget_Fix/) | 2026-02-13 | PASS |
8383
| P9-T4 | [P9-T4_Create_the_publishing_helper/](P9-T4_Create_the_publishing_helper/) | 2026-02-13 | PASS |
8484
| FU-P9-T4-1 | [FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/](FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/) | 2026-02-13 | PASS |
85+
| FU-P9-T2-2 | [FU-P9-T2-2_Add_troubleshooting_guidance_for_stale_uvx_cache_process_versions/](FU-P9-T2-2_Add_troubleshooting_guidance_for_stale_uvx_cache_process_versions/) | 2026-02-13 | PASS |
8586

8687
## Historical Artifacts
8788

@@ -129,6 +130,7 @@
129130
| [REVIEW_BUG-T0_Uptime_Widget.md](BUG-T0_Uptime_Widget_Fix/REVIEW_BUG-T0_Uptime_Widget.md) | Review report for BUG-T0 |
130131
| [REVIEW_p9_t4_publishing_helper.md](P9-T4_Create_the_publishing_helper/REVIEW_p9_t4_publishing_helper.md) | Review report for P9-T4 |
131132
| [REVIEW_fu_p9_t4_1_publish_helper_protected_main.md](FU-P9-T4-1_Align_publish_helper_output_with_protected_main_branch_workflow/REVIEW_fu_p9_t4_1_publish_helper_protected_main.md) | Review report for FU-P9-T4-1 |
133+
| [REVIEW_fu_p9_t2_2_stale_uvx_troubleshooting.md](FU-P9-T2-2_Add_troubleshooting_guidance_for_stale_uvx_cache_process_versions/REVIEW_fu_p9_t2_2_stale_uvx_troubleshooting.md) | Review report for FU-P9-T2-2 |
132134

133135
## Archive Log
134136

@@ -211,4 +213,6 @@
211213
| 2026-02-13 | P9-T4 | Archived Create_the_publishing_helper (PASS) |
212214
| 2026-02-13 | P9-T4 | Archived REVIEW_p9_t4_publishing_helper report |
213215
| 2026-02-13 | FU-P9-T4-1 | Archived Align_publish_helper_output_with_protected_main_branch_workflow (PASS) |
216+
| 2026-02-13 | FU-P9-T2-2 | Archived Add_troubleshooting_guidance_for_stale_uvx_cache_process_versions (PASS) |
217+
| 2026-02-13 | FU-P9-T2-2 | Archived REVIEW_fu_p9_t2_2_stale_uvx_troubleshooting report |
214218
| 2026-02-13 | FU-P9-T4-1 | Archived REVIEW_fu_p9_t4_1_publish_helper_protected_main report |

SPECS/INPROGRESS/next.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ The previously selected task has been archived.
44

55
## Recently Archived
66

7+
- 2026-02-13 — FU-P9-T2-2: Add troubleshooting guidance for stale uvx cache/process versions (PASS)
78
- 2026-02-13 — FU-P9-T4-1: Align publish_helper output with protected main branch workflow (PASS)
89
- 2026-02-13 — P9-T4: Create the publishing helper (PASS)
910
- 2026-02-13 — BUG-T0: Uptime widget on Web UI always shows 1h 0m 0s (PASS)
1011
- 2026-02-13 — FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras (PASS)
11-
- 2026-02-13 — FU-REBUILD-P10-T1-7: Include Web UI static assets in published package artifacts (PASS)
1212

1313
## Suggested Next Tasks
1414

SPECS/Workplan.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,7 @@ Main branch is currently unstable after an accidental merge of the Phase 10 Web
12151215
Phase 9 Follow-up Backlog
12161216
- [x] FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras (P1)
12171217
- [x] FU-P9-T4-1: Align publish_helper output with protected main branch workflow (P1)
1218+
- [x] FU-P9-T2-2: Add troubleshooting guidance for stale uvx cache/process versions (P1)
12181219

12191220
#### ✅ FU-P9-T2-1: Fix uvx Web UI examples to include `webui` extras
12201221
- **Description:** Resolve documentation/config mismatch where examples use `uvx --from mcpbridge-wrapper ... --web-ui` without optional dependencies. Update all uvx Web UI examples to install extras via `--from mcpbridge-wrapper[webui]`, and align troubleshooting/runtime guidance with the correct uvx command.
@@ -1254,6 +1255,26 @@ Phase 9 Follow-up Backlog
12541255

12551256
---
12561257

1258+
#### ✅ FU-P9-T2-2: Add troubleshooting guidance for stale uvx cache/process versions
1259+
- **Description:** Document the failure mode where Cursor or manual Web UI sessions keep running an older `uvx` environment (for example `mcpbridge-wrapper==0.3.2`) after a fix is released, causing stale behavior such as uptime stuck at `1h 0m 0s`. Add explicit verification and recovery steps using port/PID inspection, version checks, process restart, and `uvx --refresh`.
1260+
- **Priority:** P1
1261+
- **Dependencies:** P9-T2, FU-P9-T2-1
1262+
- **Parallelizable:** yes
1263+
- **Outputs/Artifacts:**
1264+
- Updated `docs/troubleshooting.md` with a dedicated section for stale `uvx` cache/process diagnosis
1265+
- Updated setup docs (at minimum `docs/cursor-setup.md`) with a one-time `--refresh` guidance note after new releases
1266+
- Optional quick-check snippet in `README.md` for confirming active runtime package version on a dashboard port
1267+
- **Acceptance Criteria:**
1268+
- [x] Troubleshooting docs include symptom/cause/fix for: uptime or behavior unchanged after upgrade
1269+
- Docs provide concrete commands to:
1270+
- [x] identify process listening on Web UI port
1271+
- [x] inspect active runtime version from that process
1272+
- [x] restart with `uvx --refresh --from mcpbridge-wrapper[webui] ...`
1273+
- [x] Recovery steps explicitly mention that multiple wrapper processes can coexist and mask upgrades
1274+
- [x] Guidance is validated against a local repro where an old process serves stale behavior and a refreshed process resolves it
1275+
1276+
---
1277+
12571278
### Phase 11: Web UI UX Improvements
12581279

12591280
**Intent:** Enhance the dashboard with better debugging tools, session awareness, theming, and keyboard-driven workflows.

Sources/XcodeMCPWrapper/Documentation.docc/CursorSetup.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,3 +148,28 @@ Make sure Xcode Tools MCP is enabled in Xcode:
148148
2. Select **Intelligence**
149149
3. Toggle **Xcode Tools** ON
150150
4. Restart Cursor
151+
152+
**"Web UI still shows old behavior after an upgrade"**
153+
154+
If Cursor is configured with Web UI args and behavior looks stale after upgrading, force a one-time uvx refresh:
155+
156+
```json
157+
{
158+
"mcpServers": {
159+
"xcode-tools": {
160+
"command": "uvx",
161+
"args": [
162+
"--refresh",
163+
"--from",
164+
"mcpbridge-wrapper[webui]",
165+
"mcpbridge-wrapper",
166+
"--web-ui",
167+
"--web-ui-port",
168+
"8080"
169+
]
170+
}
171+
}
172+
}
173+
```
174+
175+
Restart Cursor after saving config. Once verified, you can remove `--refresh` from args.

Sources/XcodeMCPWrapper/Documentation.docc/Troubleshooting.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,49 @@ Then restart your MCP client.
143143

144144
If you do not need Web UI, remove `--web-ui` and `--web-ui-port` from MCP config args.
145145

146+
## Error: "Uptime still shows 1h 0m 0s" or behavior is unchanged after upgrade
147+
148+
**Symptom:** You upgraded to a newer release, but dashboard behavior still matches an older version (for example uptime stays `1h 0m 0s`).
149+
150+
**Cause:** A previously started wrapper process is still running from an older `uvx` cache environment. New installs do not replace already-running processes.
151+
152+
**Diagnosis:**
153+
154+
```bash
155+
# 1) Find the process serving your Web UI port
156+
PORT=8080
157+
PID=$(lsof -tiTCP:$PORT -sTCP:LISTEN | head -n1)
158+
ps -p "$PID" -o command=
159+
160+
# 2) Print the mcpbridge-wrapper version used by that exact process
161+
PY=$(ps -p "$PID" -o command= | awk '{print $1}')
162+
"$PY" -c 'import importlib.metadata as m; print(m.version("mcpbridge-wrapper"))'
163+
```
164+
165+
If the reported version is older than expected, you are connected to a stale runtime.
166+
167+
**Recovery:**
168+
169+
```bash
170+
# Stop the stale process
171+
kill "$PID"
172+
173+
# Start with a refreshed uvx environment
174+
uvx --refresh --from 'mcpbridge-wrapper[webui]' mcpbridge-wrapper --web-ui --web-ui-port 8080
175+
```
176+
177+
Then reload the dashboard and verify uptime increases:
178+
179+
```bash
180+
curl -s http://127.0.0.1:8080/api/metrics | jq .uptime_seconds
181+
sleep 2
182+
curl -s http://127.0.0.1:8080/api/metrics | jq .uptime_seconds
183+
```
184+
185+
The second value should be larger.
186+
187+
**Important:** Multiple wrapper processes can run at the same time (for different ports or restarts), which can mask upgrades. Always verify the version for the process bound to the port you are viewing.
188+
146189
## Tool Returns Empty Results
147190

148191
**Symptom:** Tools execute but return no data.

Sources/XcodeMCPWrapper/Documentation.docc/XcodeMCPWrapper.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,21 @@ With Web UI dashboard (optional — adds real-time monitoring at http://localhos
6666
}
6767
```
6868

69+
If you upgrade and want to confirm the currently running dashboard process version:
70+
71+
```bash
72+
PORT=8080
73+
PID=$(lsof -tiTCP:$PORT -sTCP:LISTEN | head -n1)
74+
PY=$(ps -p "$PID" -o command= | awk '{print $1}')
75+
"$PY" -c 'import importlib.metadata as m; print(m.version("mcpbridge-wrapper"))'
76+
```
77+
78+
If needed, do a one-time refresh start:
79+
80+
```bash
81+
uvx --refresh --from 'mcpbridge-wrapper[webui]' mcpbridge-wrapper --web-ui --web-ui-port 8080
82+
```
83+
6984
Restart Cursor and you're done. For other clients or installation methods, read on.
7085

7186
### Python Environment Setup (Development)

0 commit comments

Comments
 (0)