Commit 69f98f8
feat(launcher-standard): cross-platform browser launch + env-overridable wait timing
Two related template improvements that the standard had already partly
declared but never specified or implemented in the reference templates.
The prose template covered only `xdg-open` / `firefox` / `chromium` —
Linux-only despite the standard's stated cross-platform commitment
(launcher-standard.adoc §System Integration Modes design principle 2).
On macOS the template fell through to "Open manually: $URL"; on
Windows-via-Git-Bash and on WSL it did too, even though every modern
WSL install has `wslview` and Git Bash has `start`.
Fix:
- `$BROWSER` env var honoured first (de-facto Unix convention; lets
users / operators override without re-minting the launcher).
- Platform dispatch via `uname -s`:
- macOS: `open`
- Linux: WSL detection via `/proc/version contains "microsoft"` →
`wslview` preferred (opens in Windows-side default browser; native
Linux browsers either land in WSLg or fail). Otherwise the
existing `xdg-open` → `firefox` → `chromium` chain.
- Windows (MINGW/MSYS/CYGWIN under Git Bash): `start` (cmd builtin)
- Fallback unchanged: print "Open manually: $URL"
a2ml gains `[browser-launch]` declaring the resolution order
declaratively so consumers (`launch-scaffolder`, audit tools) can
reason about it without re-parsing the bash.
The a2ml had `wait-for-url-timeout-seconds = 15` but the bash template
hardcoded `wait_for_server 15` — operators on slow hosts had no way
to extend the timeout short of editing the script. Also the template
had no per-request timeout: a single hung TCP connection could block
the whole polling loop.
Fix to `[runtime]`:
- `wait-for-url-timeout-env-var = "WAIT_FOR_URL_TIMEOUT_SECONDS"` —
formalises the override name
- `wait-for-url-poll-interval-seconds = 1` + env var (was implicit in
the template's `sleep 1`)
- `wait-for-url-per-request-timeout-seconds = 2` — caps each curl probe
Fix to template:
- `local max_wait="${1:-${WAIT_FOR_URL_TIMEOUT_SECONDS:-15}}"` — chain
arg → env → default
- `curl -fsS --max-time "$per_request_timeout"` — bounded per-request
- Error message now tells operators how to extend the timeout
Both files in the same commit per the lock-step requirement and the
gate in PR #172. Bash blocks pass `bash -n` syntax check.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a03e5a3 commit 69f98f8
2 files changed
Lines changed: 86 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
79 | 83 | | |
80 | | - | |
81 | | - | |
82 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | | - | |
86 | | - | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | | - | |
| 92 | + | |
89 | 93 | | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
93 | | - | |
94 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
| 100 | + | |
96 | 101 | | |
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
105 | 122 | | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
118 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
119 | 161 | | |
120 | 162 | | |
121 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
95 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
99 | 109 | | |
100 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
101 | 126 | | |
102 | 127 | | |
103 | 128 | | |
| |||
0 commit comments