title: How to prevent duplicate action execution in Bixby?
body: <p>I want to implement a capsule that does a calculation if the user provides the full input necessary for the calculation or asks the user for the necessary input if the user doesn't provide the full input with the very first request. Everything works if the user provides the full request. If the user doesn't provide the full request but Bixby needs more information, I run into some strange behavior where the Calculation is being called more than once and Bixby takes the necessary information for the Calculation from a result of another Calculation, it looks like in the debug graph.</p>
  
  <p>To easier demonstrate my problem I've extended the dice sample capsule <a href="https://github.com/bixbydevelopers/capsule-sample-dice" rel="nofollow noreferrer">capsule-sample-dice</a> and added <code>numSides</code> and <code>numDice</code> to the <code>RollResultConcept</code>, so that I can access the number of dice and sides in the result.
  RollResult.model.bxb now looks like this:</p>
  
  <pre><code>structure (RollResultConcept) {
    description (The result object produced by the RollDice action.)
    property (sum) {
      type (SumConcept)
      min (Required)
      max (One)
    }
    property (roll) {
      description (The list of results for each dice roll.)
      type (RollConcept)
      min (Required)
      max (Many)
    }
    // The two properties below have been added
    property (numSides) {
      description (The number of sides that the dice of this roll have.)
      type (NumSidesConcept)
      min (Required)
      max (One)
    }
    property (numDice) {
      description (The number of dice in this roll.)
      type (NumDiceConcept)
      min (Required)
      max (One)
    }
  }
  </code></pre>
  
  <p>I've also added <code>single-line</code>s in <code>RollResult.view.bxb</code> so that the number of sides and dice are being shown to the user after a roll.
  RollResult.view.bxb:</p>
  
  <pre><code> result-view {
     match {
       RollResultConcept (rollResult)
     }
  
     render {
       layout {
         section {
           content {
             single-line {
               text {
                 style (Detail_M)
                 value ("Sum: #{value(rollResult.sum)}")
               }
             }
             single-line {
               text {
                 style (Detail_M)
                 value ("Rolls: #{value(rollResult.roll)}")
               }
             }
             // The two single-line below have been added
             single-line {
               text {
                 style (Detail_M)
                 value ("Dice: #{value(rollResult.numDice)}")
               }
             }
             single-line {
               text {
                 style (Detail_M)
                 value ("Sides: #{value(rollResult.numSides)}")
               }
             }
           }
         }
       }
     }
   }
  </code></pre>
  
  <hr>
  
  <p>Edit: I forgot to add the code that I changed in <code>RollDice.js</code>, see below:
  RollDice.js</p>
  
  <pre><code>// RollDice
  // Rolls a dice given a number of sides and a number of dice
  
  // Main entry point
  module.exports.function = function rollDice(numDice, numSides) {
  
    var sum = 0;
    var result = [];
  
    for (var i = 0; i &lt; numDice; i++) {
      var roll = Math.ceil(Math.random() * numSides);
      result.push(roll);
      sum += roll;
    }
  
    // RollResult
    return {
      sum: sum,           // required Sum
      roll: result,       // required list Roll
      numSides: numSides, // required for numSides
      numDice: numDice    // required for numDice
    }
  }
  </code></pre>
  
  <p>End Edit</p>
  
  <hr>
  
  <p>In the Simulator I now run the following query</p>
  
  <pre><code>intent {
    goal: RollDice
    value: NumDiceConcept(2)
  }
  </code></pre>
  
  <p>which is missing the required <code>NumSidesConcept</code>.</p>
  
  <p>Debug view shows the following graph, with <code>NumSidesConcept</code> missing (as expected).
  <a href="https://i.stack.imgur.com/24PRg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/24PRg.png" alt="Debug Graph 1"></a></p>
  
  <p>I now run the following query in the simulator</p>
  
  <pre><code>intent {
    goal: RollDice
    value: NumDiceConcept(2)
    value: NumSidesConcept(6)
  }
  </code></pre>
  
  <p>which results in the following Graph in Debug view:</p>
  
  <p><a href="https://i.stack.imgur.com/KUvwk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KUvwk.png" alt="Debug Graph 2"></a></p>
  
  <p>and it looks like to me that the Calculation is being done twice in order to get to the Result. I've already tried giving the <code>feature { transient }</code> to the models, but that didn't change anything. Can anybody tell me what's happening here? Am I not allowed to use the same primitive models in an output because they will be used by Bixby when trying to execute an action?</p>