Skip to content

fix(stack): give Vector a readiness-capable config so eager start succeeds - #6773

Merged
avallete merged 7 commits into
developfrom
avallete/stack-vector-readiness
Sep 24, 2026
Merged

avallete merged 7 commits into
developfrom
avallete/stack-vector-readiness

Conversation

@avallete

@avallete avallete commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

TL;DR

stack start --eager timed out whenever analytics was enabled. The culprit was Vector, not Logflare: Vector ran its bundled demo config, which disables its API, so the health check never answered. The Vector recipe now always loads a stack-owned API config, and stack start failures name the service that failed.

Before

sequenceDiagram
    participant CLI as stack start --eager
    participant Stack as Stack orchestrator
    participant Vector
    CLI->>Stack: start composition
    Stack->>Vector: launch (no --config)
    Note over Vector: bundled demo config<br/>API disabled, fake log lines
    loop readiness, 60s
        Stack->>Vector: GET /health
        Vector--xStack: nothing listening
    end
    Stack-->>CLI: "Composition start had failures"
    Note over CLI: no service named,<br/>looked like an analytics problem
Loading

After

sequenceDiagram
    participant CLI as stack start --eager
    participant Stack as Stack orchestrator
    participant Vector
    CLI->>Stack: start composition
    Note over Stack: prepare writes (atomically)<br/>API config + quiet default pipeline
    Stack->>Vector: launch --config pipeline --config api
    Stack->>Vector: GET /health
    Vector-->>Stack: 200
    Stack-->>CLI: started
    Note over CLI: on any failure:<br/>"vector (id): Service health timed out"
Loading

What changed

  • Vector recipe:
    • Always writes a stack-owned API config (api.enabled, address from VECTOR_API_ADDRESS). Vector has no flag or environment variable for this.
    • Loads it as a second --config next to the pipeline config.
    • The pipeline is the caller's configPath when given, otherwise a quiet default that forwards nothing. The demo's fake log lines no longer reach the stack logs.
  • Safe file handling: config writes are atomic because background preparation can overlap a start. Destroy removes only the recipe's own files and empty parent directories, so a caller's config stored nearby survives.
  • Clearer failures: stack start lists each failed service as service (id): error. Per-service errors are one line that keeps nested causes, instead of a stack trace.

Why only --eager showed it: lazy starts never wake Vector during stack start, so its broken health check stayed hidden.

Out of scope: forwarding service logs into Analytics is still not implemented.

🤖 Generated with Claude Code

…ceeds

Vector ran its image/artifact demo config, which disables the API, so its
/health never answered and `stack start --eager` timed out whenever
analytics was enabled. The recipe now always loads a stack-owned API
config next to the pipeline config (caller configPath or a quiet default).

`stack start` failures now name the failing service, and per-service
errors are one line including nested causes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avallete
avallete requested a review from a team as a code owner September 24, 2026 08:55
avallete and others added 2 commits September 24, 2026 10:56
…tor-readiness

# Conflicts:
#	apps/cli/src/commands/experimental/stack/start/start.handler.ts
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avallete

Copy link
Copy Markdown
Member Author

/ai-review

@github-actions github-actions Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a newer AI review

🤖 AI Review

Four reported findings reduce to three distinct issues. Vector can delete a caller-owned pipeline during destroy and can conflict with an existing custom API configuration. The new error formatter can omit deeper causes. All three are confirmed from the checked-out code.

Findings

Severity Location Category Sources Claim
🟠 MAJOR packages/stack/src/services/Vector.ts:119 data-loss codex Destroying Vector deletes a caller-supplied pipeline if its configPath is inside the generated Vector config directory.
🟠 MAJOR packages/stack/src/services/Vector.ts:98 compatibility claude A caller pipeline with a conflicting API address is now loaded alongside a generated API configuration, without validation or a clear configuration error from prepare.
🟡 MINOR packages/stack/src/Orchestrator.ts:58 error-handling claude+codex Distinct nested errors with the same message cause causeMessage to omit deeper causes.

Stats

Claude findings: 2 · Codex findings: 2 · Confirmed: 3 · Refuted: 0 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread packages/stack/src/services/Vector.ts Outdated
Comment thread packages/stack/src/services/Vector.ts
Comment thread packages/stack/src/Orchestrator.ts Outdated
avallete and others added 2 commits September 24, 2026 12:36
…ains

Vector destroy now removes only the files the recipe wrote and the
directories left empty, so a caller pipeline beside them survives.
causeMessage follows the whole cause chain, collapsing only a repeated
message from a wrapper.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k paths

A caller configPath that declares `api` would conflict with the recipe's
API config at Vector startup, and one pointing at a stack-owned file
would be overwritten or deleted. Prepare now fails with a clear error
for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@avallete
avallete enabled auto-merge September 24, 2026 11:03
@avallete

Copy link
Copy Markdown
Member Author

/ai-review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

The Vector readiness change has three minor edge cases: API detection can misclassify caller configs, a crash can leave directories behind after destroy, and a symlink can bypass the owned-path guard. The reported YAML block-scalar rejection does not occur.

Findings

Severity Location Category Sources Claim
🟡 MINOR packages/stack/src/services/Vector.ts:73 correctness claude The text-based API checks do not reliably identify a top-level api setting. The TOML regex can match api = ... inside a multiline value or nested table, while the YAML regex misses a top-level flow-style mapping.
🟡 MINOR packages/stack/src/services/Vector.ts:161 resource-cleanup claude A process crash during an atomic config write can leave a .vector-write-* directory that prevents Vector service destroy from removing its instance directory.
🟡 MINOR packages/stack/src/services/Vector.ts:125 path-validation claude A symlink to a stack-owned Vector config can bypass the configPath guard. In particular, a symlink to the existing default pipeline is accepted, then becomes dangling when destroy deletes its target.
Refuted findings (kept for transparency, not posted as review comments)
  • packages/stack/src/services/Vector.ts:74 (correctness): The YAML API check rejects a valid pipeline because an indented "api": ... line inside a block scalar matches its regex.
    Refuted: Vector.ts:74 uses /^["']?api["']?\s*:/mu, which has no allowance for whitespace before api. An indented line inside a YAML block scalar does not match. This differs from Claude's finding about flow-style YAML being missed.

Stats

Claude findings: 3 · Codex findings: 1 · Confirmed: 3 · Refuted: 1 · Uncertain: 0


Models: claude-opus-5-5 + gpt-6-sol · Trigger: manual · Workflow run

This review runs once per PR. A maintainer can request another with a /ai-review comment.

Comment thread packages/stack/src/services/Vector.ts Outdated
Comment thread packages/stack/src/services/Vector.ts
Comment thread packages/stack/src/services/Vector.ts Outdated
avallete and others added 2 commits September 24, 2026 13:15
…ed writes

Drop the text-based `api` detection, which cannot identify a top-level
key reliably without a YAML/TOML parser; Vector itself rejects a
conflicting API address. The stack-owned path guard now compares real
paths, and destroy removes temporary write directories left by an
interrupted prepare.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tor-readiness

# Conflicts:
#	apps/cli/src/commands/experimental/stack/start/start.handler.ts
#	apps/cli/src/commands/experimental/stack/start/start.integration.test.ts
@avallete
avallete added this pull request to the merge queue Sep 24, 2026
Merged via the queue into develop with commit efcb61c Sep 24, 2026
29 checks passed
@avallete
avallete deleted the avallete/stack-vector-readiness branch September 24, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants