Step 2: restore the rest of the boot path in application.ex.

848ea44774e8 · AtlantisPleb · · parent 4caab400f31c

Step 2: restore the rest of the boot path in application.ex.

- Calls OpenAgents.Voice.Config.validate_boot!/0 after artifacts.
- Builds and installs the tool catalog in application.ex and removes the
  duplicate install from OpenAgents.Sarah.Supervisor.
- Starts OpenAgents.Tools.Embeddings.warm/1 and
  OpenAgents.Changelog.Backfill.boot/0 off the boot path after the supervisor
  is up.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By
Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified lib/openagents/application.ex
  • modified lib/openagents/sarah/supervisor.ex

Diff

2 files changed, +27 -8

lib/openagents/application.ex modified +27 -3

@@ -15,8 +15,15 @@ defmodule OpenAgents.Application do

15 15
    end
16 16
17 17
    # Install immutable release artifacts before any traffic can reach them.
18
    OpenAgents.Persona.install!(OpenAgents.Persona.SourceManifest.load!())
19
    OpenAgents.ProgramArtifacts.install!()
18
    source_manifest = OpenAgents.Persona.SourceManifest.load!()
19
    _persona = OpenAgents.Persona.install!(source_manifest)
20
    _program_catalog = OpenAgents.ProgramArtifacts.install!()
21
    :ok = OpenAgents.Voice.Config.validate_boot!()
22
23
    # Build and install the tool catalog; this snapshot is passed to the
24
    # embedding warmer and the turn supervisor below.
25
    tool_snapshot =
26
      OpenAgents.Tools.Registry.install!(Application.fetch_env!(:openagents, :tools))
20 27
21 28
    children = [
22 29
      OpenAgentsWeb.Telemetry,

@@ -33,7 +40,24 @@ defmodule OpenAgents.Application do

33 40
    # See https://elixir.hexdocs.pm/Supervisor.html
34 41
    # for other strategies and supported options
35 42
    opts = [strategy: :one_for_one, name: OpenAgents.Supervisor]
36
    Supervisor.start_link(children, opts)
43
    result = Supervisor.start_link(children, opts)
44
45
    # Warm the tool-embedding index off the boot path: the HTTP client is up by
46
    # now, and if embeddings are disabled this is an immediate no-op. Tool
47
    # selection falls back to lexical until (and if) the index is warm, so a
48
    # cold or failed warm never blocks or breaks a turn.
49
    #
50
    # Changelog backfill is likewise idempotent and non-blocking.
51
    case result do
52
      {:ok, _pid} ->
53
        Task.start(fn -> OpenAgents.Tools.Embeddings.warm(tool_snapshot) end)
54
        Task.start(fn -> OpenAgents.Changelog.Backfill.boot() end)
55
56
      _error ->
57
        :ok
58
    end
59
60
    result
37 61
  end
38 62
39 63
  # Tell Phoenix to update the endpoint configuration
lib/openagents/sarah/supervisor.ex modified -5

@@ -15,11 +15,6 @@ defmodule OpenAgents.Sarah.Supervisor do

15 15
16 16
  @impl true
17 17
  def init(_init_arg) do
18
    # The turn path and any tool-execution path require the host tool catalog
19
    # to be installed in :persistent_term before they run.
20
    _tool_snapshot =
21
      OpenAgents.Tools.Registry.install!(Application.fetch_env!(:openagents, :tools))
22
23 18
    children =
24 19
      [
25 20
        {Registry, keys: :unique, name: OpenAgents.HordeRegistry},

This page updates live while a promote is in flight · changelog