-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add cross-platform service management helper #421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -343,6 +343,7 @@ tasks: | |
| - task: quality:vet | ||
| - task: quality:staticcheck | ||
| - task: quality:shellcheck | ||
| - task: service:test | ||
| - task: lint:changed | ||
|
|
||
| test:provider-smoke-matrix:test: | ||
|
|
@@ -356,25 +357,19 @@ tasks: | |
| cmds: | ||
| - task: preflight | ||
| - task: quality:docs-open-items-parity | ||
| <<<<<<< HEAD | ||
| - task: quality:docs-phase-placeholders | ||
| ======= | ||
| >>>>>>> archive/pr-234-head-20260223 | ||
| - ./.github/scripts/release-lint.sh | ||
|
|
||
| quality:docs-open-items-parity: | ||
| desc: "Prevent stale status drift in fragmented open-items report" | ||
| cmds: | ||
| - ./.github/scripts/check-open-items-fragmented-parity.sh | ||
|
|
||
| <<<<<<< HEAD | ||
| quality:docs-phase-placeholders: | ||
| desc: "Reject unresolved placeholder-like tokens in planning reports" | ||
| cmds: | ||
| - ./.github/scripts/check-phase-doc-placeholder-tokens.sh | ||
|
|
||
| ======= | ||
| >>>>>>> archive/pr-234-head-20260223 | ||
| test:smoke: | ||
| desc: "Run smoke tests for startup and control-plane surfaces" | ||
| deps: [preflight, cache:unlock] | ||
|
|
@@ -484,6 +479,37 @@ tasks: | |
| cmds: | ||
| - docker compose down | ||
|
|
||
| # -- Service Operations -- | ||
| service:status: | ||
| desc: "Show service status for installed system service" | ||
| cmds: | ||
| - ./scripts/cliproxy-service.sh status | ||
|
|
||
| service:start: | ||
| desc: "Start cliproxyapi++ service (systemd/launchd/Windows helper)" | ||
| cmds: | ||
| - ./scripts/cliproxy-service.sh start | ||
|
|
||
| service:stop: | ||
| desc: "Stop cliproxyapi++ service (systemd/launchd/Windows helper)" | ||
| cmds: | ||
| - ./scripts/cliproxy-service.sh stop | ||
|
|
||
| service:restart: | ||
| desc: "Restart cliproxyapi++ service (systemd/launchd/Windows helper)" | ||
| cmds: | ||
| - ./scripts/cliproxy-service.sh restart | ||
|
|
||
| service:install: | ||
| desc: "Install cliproxyapi++ service scaffold (systemd/launchd)" | ||
| cmds: | ||
| - ./scripts/cliproxy-service.sh install | ||
|
|
||
| service:test: | ||
| desc: "Run cliproxy service helper contract tests" | ||
| cmds: | ||
| - ./scripts/cliproxy-service-test.sh | ||
|
Comment on lines
+482
to
+511
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Running 🤖 Prompt for AI Agents |
||
|
|
||
| # -- Health & Diagnostics (UX/DX) -- | ||
| doctor: | ||
| desc: "Check environment health for cliproxyapi++" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -506,17 +506,14 @@ func GenerateTokenFileName(tokenData *KiroTokenData) string { | |
| return fmt.Sprintf("kiro-%s-%s.json", authMethod, sanitizedEmail) | ||
| } | ||
|
|
||
| // Generate sequence only when email is unavailable | ||
| seq := time.Now().UnixNano() % 100000 | ||
|
|
||
| // Priority 2: For IDC, use startUrl identifier with sequence | ||
| // Priority 2: For IDC, use startUrl identifier | ||
| if authMethod == "idc" && tokenData.StartURL != "" { | ||
| identifier := ExtractIDCIdentifier(tokenData.StartURL) | ||
| if identifier != "" { | ||
| return fmt.Sprintf("kiro-%s-%s-%05d.json", authMethod, identifier, seq) | ||
| return fmt.Sprintf("kiro-%s-%s.json", authMethod, identifier) | ||
| } | ||
| } | ||
|
|
||
| // Priority 3: Fallback to authMethod only with sequence | ||
| return fmt.Sprintf("kiro-%s-%05d.json", authMethod, seq) | ||
| // Priority 3: Fallback to authMethod only | ||
| return fmt.Sprintf("kiro-%s.json", authMethod) | ||
|
Comment on lines
+509
to
+518
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Token filename collisions when email is unavailable and multiple accounts share the same IDC The comment (Line 492) says the sequence suffix was only needed "when email is unavailable", yet both the IDC-identifier path (Line 513) and the fallback path (Line 518) have now dropped it entirely. Two users authenticating via the same IDC tenant ( 🐛 Proposed fix — restore a stable disambiguator for the non-email paths // Priority 2: For IDC, use startUrl identifier
if authMethod == "idc" && tokenData.StartURL != "" {
identifier := ExtractIDCIdentifier(tokenData.StartURL)
if identifier != "" {
- return fmt.Sprintf("kiro-%s-%s.json", authMethod, identifier)
+ // Stable hash of startURL avoids collisions when multiple IDC
+ // tenants share the same subdomain prefix.
+ return fmt.Sprintf("kiro-%s-%s.json", authMethod, identifier)
+ // NOTE: If multi-user-per-tenant support is needed, re-add a
+ // sequence suffix here (e.g. -1, -2) or use a profile identifier.
}
}
- // Priority 3: Fallback to authMethod only
- return fmt.Sprintf("kiro-%s.json", authMethod)
+ // Priority 3: Fallback to authMethod only — risk of collision for
+ // multiple accounts; restore sequence suffix if multi-account needed.
+ return fmt.Sprintf("kiro-%s.json", authMethod)🤖 Prompt for AI Agents |
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify Windows restart support in docs.
The command list includes
task service:restart, but Windows behavior text omits restart. Align both to avoid ambiguity.Proposed doc tweak
🤖 Prompt for AI Agents