mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
fix(tools): say when get_wind answers from a stale forecast run
When the model upstream fails, the wind proxy keeps serving its last run, however old, with manifest.stale set. The wind layer shows that, but get_wind ignored it and gave the old run's wind as current. get_wind now returns stale and adds "(forecast may be stale)" to its summary, the way get_weather and the space tools flag stale data. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
713285b554
commit
fb88dd6e1b
3 files changed
+35
-2
No files matched your search
@@ -204,10 +204,14 @@ export const getWind = defineTool({
|
||||
const speed = windSpeed(vector.u, vector.v);
|
||||
const from = windFrom(vector.u, vector.v);
|
||||
const kph = speed * 3.6;
|
||||
// When the model upstream fails, the proxy keeps serving the last run it
|
||||
// has, however old, marked stale.
|
||||
const stale = snapshot.stale === true;
|
||||
return {
|
||||
summary:
|
||||
`Wind at ${point.label}: ${kph.toFixed(0)} km/h` +
|
||||
(from === 'Calm' ? ', calm.' : ` from the ${from}.`),
|
||||
(from === 'Calm' ? ', calm' : ` from the ${from}`) +
|
||||
(stale ? ' (forecast may be stale).' : '.'),
|
||||
data: {
|
||||
view: suggestView(services, {
|
||||
point,
|
||||
@@ -224,6 +228,7 @@ export const getWind = defineTool({
|
||||
level: snapshot.level ?? '10 m above ground',
|
||||
model,
|
||||
cycle: snapshot.cycle ?? null,
|
||||
stale,
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user