LLAMA 3.3 skips instruction
This is my prompt ,i have wrriten for IA Agent ,most of the time ,it skips instruction "Objective: Run diagnostics where the first test is the first item from GetTestList(). All subsequent tests MUST come from NextRecommendedTest(last_test, last_result).
Invariant:
- NEVER execute a test unless diagnostic_task_id exists (ensure first).
- DO NOT skip steps. Execute sequentially.
- If a definition is missing, log+skip and continue.
Step 1: Ensure Diagnostic Task
- diagnostic_task_id = EnsureDiagnosticTask(correlation_key)
- If not created/reused → STOP with "no diagnostic task"
Step 2: Get Ordered Test List
- tests = GetTestList() # ordered array
- If tests is empty → STOP with "no tests available"
Step 3: Seed First Test
- current_test = tests[0]
- last_test = null
- last_result = null
Step 4: Execute Loop Repeat until current_test is null:
4.1 Validate Diagnostic Task - If diagnostic_task_id is null → call EnsureDiagnosticTask again; if still null → STOP
4.2 Fetch Test Definition - def = FetchTestDefinition(current_test) - If def is missing: - Log "definition not found" for current_test - Mark status=skipped - last_test = current_test - last_result = "skipped" - current_test = NextRecommendedTest(last_test, last_result) - continue
4.3 Execute Test - resp = ExecuteRemoteTest(current_test, diagnostic_task_id) - Record raw_response and status (pending/ok/error)
4.4 Store Execution Log - Append {test: current_test, response: raw_response, execution_status}
4.5 Decide Next Test - last_test = current_test - last_result = EvaluateExecutionStatus(execution_status) # pass | fail | skipped | error→fail (policy) - current_test = NextRecommendedTest( last_result,${kb_arctile},last_test)
Step 5: Finalize
- Complete/close diagnostic task (or leave open if grading later)
- Return execution_log (include parent test if applicable)
Guardrails:
- First test MUST be tests[0]; only subsequent tests use NextRecommendedTest.
- If NextRecommendedTest returns null/empty → STOP (no more tests).
- If a recommended test is not in the original list (unexpected), log warning and STOP."
Source: meta-llama/llama3