mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-11 02:33:51 +08:00
fix: Use UTC+8 timezone for lite-plan session timestamps
Add getUtc8ISOString() helper function to generate China Standard Time timestamps instead of UTC. Applied to: - Session ID generation (shortTimestamp) - Exploration manifest timestamp - Direct planning metadata timestamp 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,8 +73,11 @@ Phase 5: Dispatch
|
|||||||
|
|
||||||
**Session Setup**:
|
**Session Setup**:
|
||||||
```javascript
|
```javascript
|
||||||
|
// Helper: Get UTC+8 (China Standard Time) ISO string
|
||||||
|
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
||||||
|
|
||||||
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
||||||
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
|
const timestamp = getUtc8ISOString().replace(/[:.]/g, '-')
|
||||||
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
|
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
|
||||||
const sessionId = `${taskSlug}-${shortTimestamp}`
|
const sessionId = `${taskSlug}-${shortTimestamp}`
|
||||||
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
||||||
@@ -237,7 +240,7 @@ const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json"
|
|||||||
const explorationManifest = {
|
const explorationManifest = {
|
||||||
session_id: sessionId,
|
session_id: sessionId,
|
||||||
task_description: task_description,
|
task_description: task_description,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: getUtc8ISOString(),
|
||||||
complexity: complexity,
|
complexity: complexity,
|
||||||
exploration_count: explorationCount,
|
exploration_count: explorationCount,
|
||||||
explorations: explorationFiles.map(file => {
|
explorations: explorationFiles.map(file => {
|
||||||
@@ -351,7 +354,7 @@ const plan = {
|
|||||||
estimated_time: "...",
|
estimated_time: "...",
|
||||||
recommended_execution: "Agent",
|
recommended_execution: "Agent",
|
||||||
complexity: "Low",
|
complexity: "Low",
|
||||||
_metadata: { timestamp: new Date().toISOString(), source: "direct-planning", planning_mode: "direct" }
|
_metadata: { timestamp: getUtc8ISOString(), source: "direct-planning", planning_mode: "direct" }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: Write plan to session folder
|
// Step 3: Write plan to session folder
|
||||||
|
|||||||
@@ -73,8 +73,11 @@ Phase 5: Dispatch
|
|||||||
|
|
||||||
**Session Setup**:
|
**Session Setup**:
|
||||||
```javascript
|
```javascript
|
||||||
|
// Helper: Get UTC+8 (China Standard Time) ISO string
|
||||||
|
const getUtc8ISOString = () => new Date(Date.now() + 8 * 60 * 60 * 1000).toISOString()
|
||||||
|
|
||||||
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
const taskSlug = task_description.toLowerCase().replace(/[^a-z0-9]+/g, '-').substring(0, 40)
|
||||||
const timestamp = new Date().toISOString().replace(/[:.]/g, '-')
|
const timestamp = getUtc8ISOString().replace(/[:.]/g, '-')
|
||||||
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
|
const shortTimestamp = timestamp.substring(0, 19).replace('T', '-')
|
||||||
const sessionId = `${taskSlug}-${shortTimestamp}`
|
const sessionId = `${taskSlug}-${shortTimestamp}`
|
||||||
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
const sessionFolder = `.workflow/.lite-plan/${sessionId}`
|
||||||
@@ -237,7 +240,7 @@ const explorationFiles = bash(`find ${sessionFolder} -name "exploration-*.json"
|
|||||||
const explorationManifest = {
|
const explorationManifest = {
|
||||||
session_id: sessionId,
|
session_id: sessionId,
|
||||||
task_description: task_description,
|
task_description: task_description,
|
||||||
timestamp: new Date().toISOString(),
|
timestamp: getUtc8ISOString(),
|
||||||
complexity: complexity,
|
complexity: complexity,
|
||||||
exploration_count: explorationCount,
|
exploration_count: explorationCount,
|
||||||
explorations: explorationFiles.map(file => {
|
explorations: explorationFiles.map(file => {
|
||||||
@@ -351,7 +354,7 @@ const plan = {
|
|||||||
estimated_time: "...",
|
estimated_time: "...",
|
||||||
recommended_execution: "Agent",
|
recommended_execution: "Agent",
|
||||||
complexity: "Low",
|
complexity: "Low",
|
||||||
_metadata: { timestamp: new Date().toISOString(), source: "direct-planning", planning_mode: "direct" }
|
_metadata: { timestamp: getUtc8ISOString(), source: "direct-planning", planning_mode: "direct" }
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: Write plan to session folder
|
// Step 3: Write plan to session folder
|
||||||
|
|||||||
Reference in New Issue
Block a user