From 25a8fa692a40d0c0e8dadfed3f1d23356a83f18f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 May 2026 15:22:41 +0000 Subject: [PATCH] fix: normalize env position to integer values Agent-Logs-Url: https://github.com/whyour/qinglong/sessions/b15f49c2-c873-406f-b52b-fcdf41e2eb6c Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- back/services/env.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/back/services/env.ts b/back/services/env.ts index cd4d0a84..74900152 100644 --- a/back/services/env.ts +++ b/back/services/env.ts @@ -27,10 +27,10 @@ export default class EnvService { envs.length > 0 && typeof envs[envs.length - 1].position === 'number' ) { - position = envs[envs.length - 1].position!; + position = this.getPrecisionPosition(envs[envs.length - 1].position!); } const tabs = payloads.map((x) => { - position = position - stepPosition; + position = this.getPrecisionPosition(position - stepPosition); const tab = new Env({ ...x, position }); return tab; }); @@ -116,7 +116,7 @@ export default class EnvService { } private getPrecisionPosition(position: number): number { - return parseFloat(position.toPrecision(16)); + return Math.trunc(parseFloat(position.toPrecision(16))); } public async envs(searchText: string = '', query: any = {}): Promise {