Skip to content

Commit d4cd503

Browse files
authored
feat: improve tooling, screenshot, grep, child_process, and source detection (#393)
1 parent 40abf99 commit d4cd503

27 files changed

+1292
-568
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@frontman-ai/astro": patch
3+
"@frontman/bindings": patch
4+
---
5+
6+
Fix Astro integration defaulting to dev host instead of production when FRONTMAN_HOST is not set, which broke production deployments. Also add stderr maxBuffer enforcement to spawnPromise to prevent unbounded memory growth from misbehaving child processes.

apps/frontman_server/config/dev.exs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,10 @@ config :frontman_server, FrontmanServerWeb.Endpoint,
6060
# Enable dev routes for dashboard and mailbox
6161
config :frontman_server, dev_routes: true
6262

63-
# Do not include metadata nor timestamps in development logs
64-
config :logger, :default_formatter, format: "[$level] $message\n"
63+
# Include metadata and timestamps in development logs for verbose debugging
64+
config :logger, :default_formatter,
65+
format: "$time $metadata[$level] $message\n",
66+
metadata: [:request_id, :task_id, :pid, :reason]
6567

6668
# Set a higher stacktrace during development. Avoid configuring such
6769
# in production as building large stacktraces may be expensive.

apps/frontman_server/lib/swarm/loop/runner.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,10 @@ defmodule Swarm.Loop.Runner do
163163
defp format_tool_result(%Swarm.ToolCall{
164164
id: id,
165165
name: name,
166-
result: %Swarm.ToolResult{content: content}
166+
result: %Swarm.ToolResult{content: content, is_error: is_error}
167167
}) do
168-
Message.tool_result(name, id, content)
168+
metadata = if is_error, do: %{is_error: true}, else: %{}
169+
Message.tool_result(name, id, content, metadata)
169170
end
170171

171172
@doc """

apps/frontman_server/lib/swarm/message.ex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ defmodule Swarm.Message do
5858
end
5959

6060
@doc "Creates a tool result message from content parts"
61-
@spec tool_result(String.t(), String.t(), [ContentPart.t()]) :: t()
62-
def tool_result(name, tool_call_id, content) when is_list(content) do
61+
@spec tool_result(String.t(), String.t(), [ContentPart.t()], map()) :: t()
62+
def tool_result(name, tool_call_id, content, metadata \\ %{}) when is_list(content) do
6363
%__MODULE__{
6464
role: :tool,
6565
name: name,
6666
tool_call_id: tool_call_id,
67-
content: content
67+
content: content,
68+
metadata: metadata
6869
}
6970
end
7071

apps/frontman_server/mix.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"plug_crypto": {:hex, :plug_crypto, "2.1.1", "19bda8184399cb24afa10be734f84a16ea0a2bc65054e23a62bb10f06bc89491", [:mix], [], "hexpm", "6470bce6ffe41c8bd497612ffde1a7e4af67f36a15eea5f921af71cf3e11247c"},
6868
"postgrex": {:hex, :postgrex, "0.22.0", "fb027b58b6eab1f6de5396a2abcdaaeb168f9ed4eccbb594e6ac393b02078cbd", [:mix], [{:db_connection, "~> 2.9", [hex: :db_connection, repo: "hexpm", optional: false]}, {:decimal, "~> 1.5 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:table, "~> 0.1.0", [hex: :table, repo: "hexpm", optional: true]}], "hexpm", "a68c4261e299597909e03e6f8ff5a13876f5caadaddd0d23af0d0a61afcc5d84"},
6969
"req": {:hex, :req, "0.5.17", "0096ddd5b0ed6f576a03dde4b158a0c727215b15d2795e59e0916c6971066ede", [:mix], [{:brotli, "~> 0.3.1", [hex: :brotli, repo: "hexpm", optional: true]}, {:ezstd, "~> 1.0", [hex: :ezstd, repo: "hexpm", optional: true]}, {:finch, "~> 0.17", [hex: :finch, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}, {:mime, "~> 2.0.6 or ~> 2.1", [hex: :mime, repo: "hexpm", optional: false]}, {:nimble_csv, "~> 1.0", [hex: :nimble_csv, repo: "hexpm", optional: true]}, {:plug, "~> 1.0", [hex: :plug, repo: "hexpm", optional: true]}], "hexpm", "0b8bc6ffdfebbc07968e59d3ff96d52f2202d0536f10fef4dc11dc02a2a43e39"},
70-
"req_llm": {:git, "https://github.com/frontman-ai/req_llm.git", "54ba39e2fba19218ac6f0a03209462e5d5877e4e", [branch: "main"]},
70+
"req_llm": {:git, "https://github.com/frontman-ai/req_llm.git", "4b59e3d08d356d0bc44fec3a0e8e89863855abc1", [branch: "main"]},
7171
"sentry": {:hex, :sentry, "11.0.4", "60371c96cefd247e0fc98840bba2648f64f19aa0b8db8e938f5a98421f55b619", [:mix], [{:hackney, "~> 1.8", [hex: :hackney, repo: "hexpm", optional: true]}, {:igniter, "~> 0.5", [hex: :igniter, repo: "hexpm", optional: true]}, {:jason, "~> 1.1", [hex: :jason, repo: "hexpm", optional: true]}, {:nimble_options, "~> 1.0", [hex: :nimble_options, repo: "hexpm", optional: false]}, {:nimble_ownership, "~> 0.3.0 or ~> 1.0", [hex: :nimble_ownership, repo: "hexpm", optional: false]}, {:opentelemetry, ">= 0.0.0", [hex: :opentelemetry, repo: "hexpm", optional: true]}, {:opentelemetry_api, ">= 0.0.0", [hex: :opentelemetry_api, repo: "hexpm", optional: true]}, {:opentelemetry_exporter, ">= 0.0.0", [hex: :opentelemetry_exporter, repo: "hexpm", optional: true]}, {:opentelemetry_semantic_conventions, ">= 0.0.0", [hex: :opentelemetry_semantic_conventions, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6", [hex: :phoenix, repo: "hexpm", optional: true]}, {:phoenix_live_view, "~> 0.20 or ~> 1.0", [hex: :phoenix_live_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.6", [hex: :plug, repo: "hexpm", optional: true]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: true]}], "hexpm", "feaafc284dc204c82aadaddc884227aeaa3480decb274d30e184b9d41a700c66"},
7272
"server_sent_events": {:hex, :server_sent_events, "0.2.1", "f83b34f01241302a8bf451efc8dde3a36c533d5715463c31c653f3db8695f636", [:mix], [], "hexpm", "c8099ce4f9acd610eb7c8e0f89dba7d5d1c13300ea9884b0bd8662401d3cf96f"},
7373
"splode": {:hex, :splode, "0.3.0", "ff8effecc509a51245df2f864ec78d849248647c37a75886033e3b1a53ca9470", [:mix], [], "hexpm", "73cfd0892d7316d6f2c93e6e8784bd6e137b2aa38443de52fd0a25171d106d81"},

0 commit comments

Comments
 (0)