summaryrefslogtreecommitdiff
path: root/Omni/Agent/Worker.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Omni/Agent/Worker.hs')
-rw-r--r--Omni/Agent/Worker.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index 79cf3c8..2949ac3 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -98,8 +98,8 @@ processTask worker task = do
endTime <- Data.Time.getCurrentTime
say ("[worker] Agent exited with: " <> tshow exitCode)
- -- Update the activity record with metrics
- TaskCore.updateActivityMetrics activityId Nothing (Just endTime) (Just costCents) Nothing
+ -- Update the activity record with metrics (convert Double to Int by rounding)
+ TaskCore.updateActivityMetrics activityId Nothing (Just endTime) (Just (round costCents)) Nothing
case exitCode of
Exit.ExitSuccess -> do
@@ -199,7 +199,7 @@ tryCommit repo msg = do
-- | Run task using native Engine
-- Returns (ExitCode, output text, cost in cents)
-runWithEngine :: Core.Worker -> FilePath -> TaskCore.Task -> IO (Exit.ExitCode, Text, Int)
+runWithEngine :: Core.Worker -> FilePath -> TaskCore.Task -> IO (Exit.ExitCode, Text, Double)
runWithEngine worker repo task = do
-- Read API key from environment
maybeApiKey <- Env.lookupEnv "OPENROUTER_API_KEY"
@@ -253,7 +253,7 @@ runWithEngine worker repo task = do
TaskCore.insertAgentEvent tid sessionId eventType contentJson
-- Build Engine config with callbacks
- totalCostRef <- newIORef (0 :: Int)
+ totalCostRef <- newIORef (0 :: Double)
let quiet = Core.workerQuiet worker
sayLog msg = if quiet then putText msg else AgentLog.log msg
engineCfg =